jQuery in Action, 2nd edition
The moose likes Beginning Java and the fly likes Reference Assignment Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Reference Assignment" Watch "Reference Assignment" New topic
Author

Reference Assignment

prakash praksh
Greenhorn

Joined: Oct 22, 2009
Posts: 2
Please let me know what happens when at line no 1 and line no2. ?




John de Michele
Rancher

Joined: Mar 09, 2009
Posts: 600
Prakash:

Have you tried it? What do you think will happen?

John.
Nicolas Kal
Ranch Hand

Joined: Sep 09, 2009
Posts: 69
Prakash,

At line 1 (9 in the snipset) object 'o' references to the same object reference of p
At line2 (11 in the snipset) object 'o' references to the array reference of variable a in line 10

Regards,
Nicolas


SCJP 6.0 , SBCD (Preparing..),
MSc Enterprise Systems Development, BSc Computer Science
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Reference Assignment
 
Similar Threads
weird statment....method cla
confusion on overriding variables
static method invocation problem
July Newsletter Puzzle (Maze Solver)
Array of Objects