answersLogoWhite

0

Reference variables in java is used to refer to an object.

Its a way to access another variable or memory address with a variable and change the data inside the memory address.

It gives direct access to the memory access.

example:-

Box b=new Box();

b is the reference variable of type Box. It can hold reference to any instance of class Box.

new Box() creates an instance of class Box. So b is now pointing to an object of class Box.

shreya..

User Avatar

Wiki User

13y ago

What else can I help you with?