Java-Assigning Object Reference

Assigning Object Reference We are assign one object reference variable to another object reference variable, we are not creating a copy of the object, we are only making a copy of the reference. For example, in the following program, the object references d1, d2 and d3 will point to the same object. Therefore, any change … Read more…

Java-Declaring Objects

Declaring Objects An object is an instance of a class. The relationship is such that many objects can be created using one class. Each object has its own data but its underlying structure are defined by the class.¬†There are two steps when creating an object from a class : Declaration A variable declaration with a … Read more…