Join David Gassner for an in-depth discussion in this video Using member classes, part of Java Advanced Training.
- View Offline
- Exercise Files
In the world of object-oriented programming we use the term encapsulation to talk about hiding data.…In Java, you can hide data as private fields, but you can also create member classes that…are contained within other classes and those member classes can be the ultimate sort of…encapsulation. I'll show you how to implement member classes using this project named member…classes, which has a main class with the main method, and two supporting classes called Olive and OliveJar.…
In the initial implementation of this project, I'm creating an instance of the OliveJar class…and then saying that I want three Kalamata olives and then I'm looping through the olives…field of the OliveJar and reporting what olives are in the jar. I'll run the code and show…that in addition to the three Kalamata olives that I put in there, the OliveJar is putting…in it's own Golden olive. Now I'm going to re-factor this code.…Right now, the entire application can see the implementation of the olive class, but…I'd like to change it so that only the OliveJar can use this class and every other part of…
- Installing Java on Windows and Mac OS X
- Installing Eclipse
- Using new features such as simplified generics
- Working with advanced class structures (member, local inner, etc.)
- Using the Reflection API
- Navigating inheritance trees
- Managing unordered and ordered sets
- Peeking and polling with queues
- Testing and error handling
- Managing files and directories
- Working with I/O streams
- Next steps with Java
Skill Level Advanced
1. Getting Started
2. Java 7 New Features
3. Using Advanced Class Structures
4. Using the Reflection API
5. More of the Collections Framework
6. Testing and Advanced Exception Handling
Using the finally keyword5m 40s
7. Managing Files and Directories in Java 7
8. Working with I/O Streams
9. Working with Multi-threading
- 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.