What will be the output of the following program?
Correct Answer : B
The program execution starts from the
main method. Two objects namely
c are created and the respective values are printed using the variables defined in those classes. But, as
c is an object, as the local variable gets more preference, the value of
c when printed, prints an object reference value. The member variable
int c in the
OutPut class will not be considered.
Hence, the answer is B.