Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

simpler java creation help please!

 
donald rieck
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
create a class > app.java
compile it > javac app.java
what goes on?:
JVM loads class.
Static members are initialized?
JVM goes to the main method.
Object is declared in main: App myApp;
Object creation: myApp = new App();
New is envoked.
New operator allocates memory.
New operator calls the super ctor.
New operaator calls the original ctor.
Constructor creates the "object."
Constructor body is not yet executed though.
Constructor initializes all instance variables to 0,null or false.
Constructor body is now executed.
Is this a good "loose" interpretation?

[ March 15, 2003: Message edited by: donald rieck ]
 
Leandro Oliveira
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
read this, it is a very complete explanation on what happens, step by step, from loading, linking, creation of objects, finalization of objects, to unloading of classes:
http://java.sun.com/docs/books/jls/second_edition/html/execution.doc.html#44411

hope it helps!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic