Join David Gassner for an in-depth discussion in this video Instantiating classes dynamically, part of Advanced Java Programming.
I've previously described how to get a reference to an object's class by using the getClass method.…This method is defined in the object class, that's the ultimate super class of the entire…Java class hierarchy.…And so it's available in all objects and returns an instance of TheClassClass.…Once you have that, you can get the classes name and also references to all of the classes…members such as constructor methods, conventional methods, and fields.…
I'll describe how to do this with constructor methods.…I'm working in a project called TypeInfo.…This is similar to previous projects, but it has a couple of changes.…First of all, I've added a new enumerator class called OliveColor, and it's going to…be used eventually to manage the colors of the olives, so that instead of passing in…long values, I'll just name the color I want.…I'll start back in the Main class, and I'll place the cursor after the existing code.…My goal is to get a reference to all of the constructor methods of this class.…
I'll move the cursor after the call to the getSimpleName method, and I'll declare a new variable.…
- 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.