Head First Java Chapter 01 Notes.

Head First Java Chapter 01

This is the first Chapter learning of Head First Java by Kathy Sierra and Bert Bates, This markdown
file is my notes for the first chapter, not sure if any copyright issues are there.

Syntax Fun:

  • Each statement must end in a semi colon.
x = x + 1;
  • A single line comment begins with two forward slashes.
//this line is a comment
  • Most white space doesn’t matter.
x = x       +            1;
  • Variables are declared with a name and a type.
int weight;
//type: int, name:weight
  • Classes and methods must be defined within a pair of curly braces.
public void go(){
//some code


There are three standard looping constructs:
1. while
2. for
3. do-while
The important ingredient to a loop is the conditional test.

Bullet Point.

  • The assignment operator uses one equals sign =.
  • The equals operator uses two equals sign ==.
  • A while loops runs everything within its block, as long as the conditional test is true.
  • If the conditional is false, the while loop code block won’t run, and execution will move to the code immediately after the loop block.



One thought on “Head First Java Chapter 01 Notes.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s