Coder Social home page Coder Social logo

java_head-first's Introduction

Java Head First Review

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."

Link to the book on Amazon


Head First Java Chapters

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)


Chapter 1 Content - Breaking the Surface: a quick dip

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

Chapter 2 - A Trip to Objectville: yes, there will be objects

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

Chapter 3 - Know Your Variables: primitives and references

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)

Chapter 4 - How Objects Behave: object state affects method behavior

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

Chapter 5 - Extra-Strength Methods: flow control, operations, and more

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()

Chapter 6 - Using the Java Library: so you don't have to write it all yourself

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

Chapter 7 - Better Living in Objectville: planning for the future

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)

Chapter 8 - Serious Polymorphism: exploiting abstract classes and interfaces

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!)

Chapter 9 - Life and Death of an Object: constructors and memory management

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)

java_head-first's People

Contributors

adefimov avatar ericrbruck avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.