-
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
Default constructor calls superclass constructor
In this example we shall show you how to call the superclass constructor in a default class constructor. An easy…
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
Deep Copy example – Part 2
This is an example of how to create a deep copy of a class. In order to create a deep copy…
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
Deep Copy example
With this example we are going to demonstrate how to create a deep copy of a class. In short, to…
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
Implementing Cloneable interface
In this example we shall show you how to implement the Cloneable interface. A class implements the Cloneable interface 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
Find a file in classpath
In this example we shall show you how to find a file in the classpath. To find a file in the…
Read More »