1.9. Java Programs

A Java program is a collection of one or more classes, with one of them containing the program's execution starting point. A Java source file can contain more than one class definition. The Java 2 SDK enforces the rule that at the most one class in the source file has public accessibility. The name of the source file is comprised of the name of this public class with .java as extension. Each class definition in a source file is compiled into a separate class file, containing Java byte code. The name of this file is comprised of the name of the class with .class as an extension. All programs must be compiled before they can be run. The Java 2 SDK provides tools for this purpose, as explained in 1.10 Sample Java Application. ...

Get Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second Edition 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.