-
class
Static value initialization
With this example we are going to demonstrate how to make static values initialization in classes. In short, to make…
Read More » -
class
Access outer variables example
This is an example of how to access outer variables in a class. The example is described in short: We have…
Read More » -
class
Null safe equals method
In this example we shall show you how to use a null safe equals method to compare objects. To use a…
Read More » -
class
Polymorphism and constructors example
With this example we are going to demonstrate the polymorphism of a class and the constructors behaviour. In short, to see…
Read More » -
class
Copy Constructor example
This is an example of how to create a copy constructor in a class. We have set the example, in order…
Read More » -
class
Exceptions in Constructors
In this example we shall show you how to handle exceptions in constructors. To handle exceptions in constructors we have performed…
Read More » -
class
Conflicting Constructors
With this example we are going to demonstrate how to use conflicting constructors in a class. In short, to use…
Read More » -
class
Generic deep copy
This is an example of how to make a generic copy of a class, using Java reflection. In order to…
Read More » -
class
Avoid side-effects with Object.clone
In this example we shall show you how to avoid side-effects when using Object.clone. To avoid side-effects when using Object.clone we…
Read More » -
class
Inheritance constructor calls example
With this example we are going to demonstrate how to inherit constructor calls from a super class to a sub…
Read More »