In a prior video, you learn about how to use static methods that are called from a class without the class first being instantiated. But when a method needs to work with persistent data that’s stored within an object, it’s known as an instance method—that is, a method that belongs to an instance of the class.
- [Instructor] In general programming terminology,…a constant is a value that gets set once…and then never changes.…In Java, there isn't a constant keyword.…Instead, you mark constant values…with the combination of the keywords "static" and "final."…"Static" means what it always does,…that a variable belongs to the class definition…and not to an instance of the class,…and "final" means that the value can only be set once.…IntelliJ IDEA makes it easy to declare simple constants.…
I'm going to place the cursor in my MathHelper class,…which I've simplified a bit so it only has one constructor,…and then, at the top of the class,…before the instance variable declarations,…I'll type…"psfs."…That means "public static final string."…I'll press Tab to complete that string,…and then I'll create a new constant.…By convention, names of constants in Java…are always all uppercase.…The value of the constant doesn't matter.…
What's important is that it's used consistently…throughout the application.…"Public" means that it's available…
- Debugging Java code
- Handling exceptions
- Creating custom classes
- Working with inheritance
- Managing data collections
- Using Java packages and libraries
- Preparing a Java application for deployment
Skill Level Intermediate
1. Exception Handling and Debugging
2. Create Custom Classes
3. Work with Inheritance
4. Manage Data Collections
5. Use Java Packages and Libraries
Work with dates and times7m 12s
6. Prepare a Java Application for Deployment
Next steps1m 12s
- 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.