When you create a new class or other type in your application, you define it in its own file. But you can combine types together in a parent-child relationship—these are called nested types, or sometimes member types.
- So far whenever I've wanted to create a new class…or other type in my application,…I've defined it in its own file.…But you can combine types together…in a parent/child relationship within a single file.…These are then called nested types,…or sometimes member types.…Let's take the operation enum…that I created in a previous video.…Right now it's in its own file, operation.java.…But it's obviously clearly related to the MathHelper class.…It's only used when you're either calling the…MathHelper class or within the MathHelper class' code.…
So this is an opportunity to reorganize the code…and make things a little bit easier to find.…I'll start in operation.java,…and I'll copy the enum declaration to the clipboard.…Then I'll go back to MathHelper.java,…I'll place the cursor within the class declaration,…but outside of any methods,…and I'll paste that code into place.…Now operation is a nested enum.…It's a nested type of the MathHelper class.…
I'll come back to operation.java,…and I'm going to select and comment out…
- 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.