Chapter 2. The ABCs of Programming

A Java program is made up of classes and objects, which, in turn, are made up of methods and variables. Methods are made up of statements and expressions, which are made up of operators.

At this point, you might be afraid that Java is like Russian nesting matryoshka dolls. Every one of those dolls seems to have a smaller doll inside it, as intricate and detailed as its larger companion.

Today’s lesson clears away the big dolls to reveal the smallest elements of Java programming. You’ll leave classes, objects, and methods alone for a day and examine the basic things you can do in a single line of Java code.

The following subjects are covered:

  • Java statements and expressions

  • Variables and primitive data types

  • Constants ...

Get Sams Teach Yourself Java™ 6 in 21 Days now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.