-
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
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
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 » -
class
A wrapper class
This is an example of how to create a wrapper class. A wrapper class is defined as a class in…
Read More » -
class
Immutable object example
With this example we are going to demonstrate how to create and use an immutable object. Immutable objects are objects…
Read More » -
class
Reference Objects example
In this example we shall show you how to create and use Reference Objects. A reference object encapsulates a reference…
Read More » -
class
Anonymous inner class – Part 2
This is an example of how to use an anonymous inner class. We have created a class, TalkingClock, that is a…
Read More » -
class
Class casting example
With this example we are going to demonstrate how to cast an object of a class to another class. In…
Read More » -
class
Anonymous class
In this example we shall show you how to use an anonymous class. To use an anonymous class we are using…
Read More » -
class
Use the keyword this to call a constructor – Part 2
This is an example of how to use the keyword this to call a constructor of a class. Within an…
Read More »