Nested Classes

By Raul Rios

A nested class is a class declared within another class. It’s a member of the enclosing class and so can be declared private, public, protected or default. A nested class can be static, inner, local or anonymous. The following sections try to clarify these sometimes-confusing terms. The two key things you must know ..Continue Reading

Access Control Modifiers

By Raul Rios

Access control modifiers let you specify what types (mainly classes) and members of those types are accessible from other types and members, in order to get a proper encapsulation. The following table summarizes the meaning of the four (really three) available access control modifiers in Java. You can read the content of ..Continue Reading

Constructors

By Raul Rios

Constructors are used to create objects (instances of a class). They are declared like methods but always using the name of the class and having no return type. Be careful about tricky questions like this: Is the following an example of a valid constructor? Does it compile?

A method name ..Continue Reading

Methods

By Raul Rios

The four things about methods that you need to grasp well  for the exam are: Arguments are always passed by value Varargs The return value Method overloading Method arguments are always passed by value, which means that any changes to the values of the arguments exist only within the scope ..Continue Reading