Hi i am actually having some problems in understand what happens in the memory ...
for example i have 2 int variables [ int x and y ]
x = 15 and y = 30
in memory for example the address of x = 0x123456 and the address of y = 0x654321
now if i did this y = 30
isn't that means in memory the address of y will be the same for x or what
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Now here in java in creating objects ...
say that i have a class called a and the attributes is name and age so when i create an object :
a objectreference = new a();
now i have allocated the memory for the object of class a and a reference called objectrefernece reference to object of class a
now how this objectreference reference to the object ? how that's done in memory
also what happens in memory when i create an object and what happen to the attributes i wish if u can answer me
↧