-
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
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
Initialize constructor with composition
This is an example of how to initialize a constructor with composition. We have created an object with reference to another…
Read More » -
class
Use serializable interface to perform deep copy
With this example we are going to demonstrate how to use the Serializable interface to perform a deep copy of…
Read More » -
class
Shallow Copy example
In this example we shall show you how to create a shallow copy of a class. To create a shallow copy…
Read More » -
class
Clonable Object example
With this example we are going to demonstrate how to create a cloneable object of a class. In short, to…
Read More » -
class
Clone class example
This is an example of how to create a clone class of a class. We have created Employee class to…
Read More » -
class
Get Classpath example
With this example we are going to demonstrate how to get the classpath using the System class. The System class…
Read More » -
class
How the class loader works
In this example we shall show you how the class loader works. To see how the class loader works we have…
Read More » -
class
Modify Immutable Objects
This is an example of how to modify immutable objects. Immutable objects are objects whose state cannot change after construction. We…
Read More »