- So how'd you make out with the…Kathie's Catering challenge?…I hope you had some fun with it.…I'd like to show you my solution…and as I always say, it might be different than yours.…Let's start with the event class.…At the top of the event class,…we have our instance data.…On line 10 is something a little bit new, though.…I have public static int nextEventNumber.…By declaring this variable as static,…it allows all the events that I create…to share the same value.…Normally, the instance data is only available…to the one object, but when you add the word static,…it allows the variable to be shared.…
An example might be what if we wanted to count up…the number of events that we have coming up?…By declaring a variable as static,…we can add one to it every time we create a new event.…It's not specific to a certain event.…It's specific to the entire collection of events.…On line 14, notice that we have…private final double pricePerGuest.…That way, if the price changes,…it's easy for us to change it in one place.…I mentioned in the challenge that I wanted you to create…
- Getting started with parsing
- Reviewing data types
- Using decisions
- Creating user-defined methods
- Command-line debugging
- Exploring the Java API
- Creating and instantiating classes
- Working with interfaces
- Storing items with arrays
Skill Level Intermediate
Q: How can I make my debugger function like the author’s?
1. Command Level Programming
2. Basics Review
4. Java API
5. Simulations and Algorithm Analysis
6. Classes and Objects
7. More on Classes
8. Data Structures
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.