Hi,
I am using JDK 1.5.
I have a program like this. Here i am directly assigning value to one object.
It does'nt give me any compile time or run time error. In java we dont have access to any object reference. Still this kind of assignment is allowed. What is the reason behind this.
But i think it initialise an objects and assigns the given value to object.
How it is implemented ?
I am using JDK 1.5.
I have a program like this. Here i am directly assigning value to one object.
It does'nt give me any compile time or run time error. In java we dont have access to any object reference. Still this kind of assignment is allowed. What is the reason behind this.
Code:
Class Sample{ public static void main(){ //Assigning value to object reference itself. Integer i = 10; System.out.println(i.intValue()); } }
How it is implemented ?
Comment