⭐Reference Variable


Home SQL Manual Testing Java Selenium

Defination:-
dot_imgReference Variable is Special Datatype which is used to store the Object Address Or Null.

dot_imgNote:-
Reference Variable holds the object address whwnever we print a refrence variable it will print the Object Address that is Fully Qualified Path.
dot_imgThe Syntax of Fully Qualified path is
folder_name/.class_name@hexadecimal_no/package_name.
Ex:-intro.Demo1@1DF26BCA <-Fully Qualified Path
dot_imgMultiple Object will have different address, any changes made in one object will not affect other object address.


Syntax

dot_img Reference Variable Declaration.
=>class_name reference_variable;
Exa:-Sample S1;

dot_imgReference Variable Initialization.
=>reference_variable = object;
Exa:- S1 = new Sample();

dot_imgReference Variable Declaration and Initialization.
=>Class_name reference_variable = object;
Exa:-Sample s1 = new Sample();

reference_variable_img