Structure of Java Programs

Programming in Java consists of writing source code that defines one or more classes. Because Java is completely object-oriented, all Java code is inside a class definition. When a Java program runs, it uses these class definitions to create objects that contain all of the program variables and instructions.

In Java, there is no such thing as a global variable or any function that is not part of a class, and therefore an object. Java groups the various utility calls you might expect to find in a system library into classes, frequently as static methods. The implications of the static keyword are discussed in Chapters ...

Get Java 2™ Programmer Exam Cram™ 2 (Exam CX-310-035) now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.