• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sequence Of events by JVM

 
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ???
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic