Table of Contents
No program without a class: Any Java program must include at least one class.
No object without a class: For creating an object, a class has to be used (or defined) for
defining the properties of the object's property slots
defining the methods and functions that can be applied to the object (and all other objects instantiating the class)
No global variables, no global methods: In Java, all variables and methods must be defined in the context of a class, which provides their name space.
Classes, properties and methods are defined with a visibility level:
Java is strongly typed: Properties, parameters and variables must be declared to be of some type.
Type parameters: Classes and complex data structures (such as lists) can be defined with the help of type parameters. See, for instance, this tutorial.
Arrays are static: Arrays have a fixed size, which cannot be changed at run-time.
Java programs must be compiled before they can be executed.
In Java, visibility levels are used to define the possible levels of access:
Table 2.1. Java Visibility Level
Normally, properties are defined as private, with public getters and setters, so they are only directly accessible at the level of the class defining them.