You are previewing Sams Teach Yourself Java in 21 Days, Sixth Edition.

Sams Teach Yourself Java in 21 Days, Sixth Edition

Cover of Sams Teach Yourself Java in 21 Days, Sixth Edition by Rogers Cadenhead Published by Sams
O'Reilly logo

Day 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 worried that Java is like a set of Russian nesting matryoshka dolls. Each doll except the smallest one has 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 will set aside classes, objects, and methods 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 ...

The best content for your career. Discover unlimited learning on demand for around $1/day.