Join David Gassner for an in-depth discussion in this video Using static initializers, part of Advanced Java Programming.
In the videos in this chapter I'm going to describe various ways of architecting your…Java classes to accomplish certain coding goals.…I'll be talking about static fields and initializing them and various kinds of classes, including…inner and anonymous classes.…I'll start in this video with static initializers.…It's very common to initialize the values of fields in constructor methods.…For instance, in this class, olive.java, this version of the constructor method initializes…the oliveName field, a public String by assigning it a value that's passed in when the constructor method is called.…
But you can also have static fields.…I showed one very popular use of static fields in the Java Essential Training Course.…In this Olive class I'm using a literal value of 0x000000 to represent the color black,…but to minimize coding errors, I might choose to use a public static final field, that looks like this.…I'll place the cursor within the Olive class and type in public static final and then the…
- 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.