aspose file tools*
The moose likes Beginning Java and the fly likes Sequence Of events by JVM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Sequence Of events by JVM" Watch "Sequence Of events by JVM" New topic
Author

Sequence Of events by JVM

Sahil Kapoor
Ranch Hand

Joined: Sep 12, 2009
Posts: 316
What is the sequence of Events taken by JVM for the follwing line of Code ??

int[] a= new int[6];

OPTION 1

1) Refernce Variable a is created first and is initializes to NULL.
2) An array object is created.
3) Information abt how to access that object is then put into the refernce variable.

Option 2

1)) An array object is created.
2) Refernce Variable a is created first and is initializes to NULL.
3) Information abt how to access that object is then put into the refernce variable.


Please explain also ???

SCJP 6.0 96%

(Connecting the Dots ....)
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19783
    
  20

The results from "java -p Test":
I'm no expert in reading this, but to me, it looks like the array is created first, then the variable is created.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sequence Of events by JVM