As a review of Java I am going through the book "Head First Java" 2nd Edition front to back. In the process I will be coding all Exercises for practice. For me the best way to learn is by doing. I will be reading the chapter for background knowledge / refresh on the subject, then doing the exercises to apply the the chapter content to programs.
"Head First Java is a complete learning experience in Java and object-oriented programming. This book helps you learn the Java Language with a unique method that does beyond syntax and how-to manuals and helps you understand how to be a great programmer. You'll learn language fundamentals, generics, threading, networking, and distributed programming, and you'll even build a "sink the dot com" game and networked drum machine chat client along the way."
Chapter 1 - Breaking the Surface: a quick dip
Chapter 2 - A Trip to Objectville: yes, there will be objects
Chapter 3 - Know Your Variables: primitives and references
Chapter 4 - How Objects Behave: object state affects method behavior
Chapter 5 - Extra-Strength Methods: flow control, operations, and more
Chapter 6 - Using the Java Library: so you don't have to write it all yourself
Chapter 7 - Better Living in Objectville: planning for the future
Chapter 8 - Serious Polymorphism: exploiting abstract classes and interfaces
Chapter 9 - Life and Death of an Object: constructors and memory management (Current)
The way Java works
Code structure in Java
Anatomy of a class
The main() method
Looping
Conditional branching (if tests)
Coding the "99 bottles of beer" app
Parse-o-matic
Fireside chat: compiler vs. JVM
Chair Wars (Brad the OO guy vs Larry the Procedural guy)
Inheritance (an introduction)
Overriding methods (an introduction)
What's in a class? (methods, instance variables)
Making your first object
Using main()
Guessing Game code
Declaring a variable (Java cares about type)
Primitive types ("I'd like a double with extra foam, please")
Java keywords
Reference variables (remote control to an object)
Object declaration and assignment
Objects on the garbage-collectible heap
Arrays (a first look)
Methods use object state (bark different)
Method arguments and return types
Pass-by-value (the variable is always copied)
Getters and Setters
Encapsulation (do it or risk humiliation)
Using references in an array
Exercises and puzzles
Building the Sink a Dot Com game
Starting with the Simple Dot Com game (a simpler version)
Writing prepcode (pseudocode for the game)
Test code for simple Dot Com
Coding the Simple Dot Com game
Final code the Simple Dot Com game
Generating random numbers with Math.random()
Ready-bake code for getting user input from the command-line
Looping with for loops
Casting primitives from a large size to a small size
Converting a String to an into with Integer.parseInt()
Analyzing the bug in the Simple Dot Com Game
ArrayList (taking advantage of the Java API)
Fixing the DotCom class code
Building the real game (Sink a Dot Com)
Prepcode for the real game
Code for the real game
boolean expressions
Using the library (Java API)
Using packages (import statements, fully-qualified names)
Using the HTML API docs and reference books
Understanding inheritance (superclass and subclass relationships)
Designing an inheritance tree (the Animal simulation)
Avoiding duplicate code (using inheritance)
Overriding methods
IS-A and HAS-A (bathtub girl)
What do you inherit from your superclass?
What does inheritance really buy you?
Polymorphism (using a supertype reference to a subclass object)
Rules for overriding (don't touch those arguments and return types!)
Method overloading (nothing more than method name re-use)
Some classes just should not be instantiated
Abstract classes (can't be instantiated)
Abstract methods (must be implemented)
Polymorphism in action
Class Object (the ultimate superclass of everything)
Taking objects out of an ArrayList (they come out as type object)
Compiler checks the reference type (before letting you call a method)
Getting in touch with your inner object
Polymorphic references
Casting an object reference (moving lower on the inheritance tree)
Deadly Diamond of Death (multiple inheritance problem)
Using interfaces (the best solution!)
The stack and the heap, where objects and variables live
Methods on the stack
Where local variables live
Where instance variables live
The miracle of object creation
Constructors (the code that runs when you say new)
Initializing the state of a new Duck
Overloaded constructors
Superclass constructors (constructor chaining)
Invoking overloaded constructors using this()
Like of an Object
Garbage Collection (and making object eligible)