0
What will be Output of the following codes:--
class A{ private int i; A(int i){ this.i=i; } } class B{ A i= new A(10); System.out.print(i); }
4 Respuestas
0
I think this will be the hexadecimal number, because you are printing an address, if you want the value you need getter function
0
In addition to..
Its error. You have to includes all definition statements in methods in java. You should have main method.. then you get i object address.
0
Jayakrishna you're right
0
Yahaj