Defination:-
Reference Variable is Special Datatype which is used to store the Object Address Or Null.
Note:-
Reference Variable holds the object address whwnever we print a refrence variable it will print the Object Address that is Fully Qualified Path.
The Syntax of Fully Qualified path is
folder_name/.class_name@hexadecimal_no/package_name.
Ex:-intro.Demo1@1DF26BCA <-Fully Qualified Path
Multiple Object will have different address, any changes made in one object will not affect other object address.
Syntax
Reference Variable Declaration.
=>class_name reference_variable;
Exa:-Sample S1;
Reference Variable Initialization.
=>reference_variable = object;
Exa:- S1 = new Sample();
Reference Variable Declaration and Initialization.
=>Class_name reference_variable = object;
Exa:-Sample s1 = new Sample();