aspose file tools*
The moose likes Java in General and the fly likes java life cycle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

java life cycle

donald rieck
Ranch Hand

Joined: Mar 12, 2003
Posts: 75
oky doky
create a class: app.java
(I'm purposly leaving out alot of the JLS stuff)
compile it: javac app.java
JVM loads class app.java.
Static members are initialized.(vars,blocks,methods)
JVM goes to the main method.
Object is declared in main: App myApp;
Object creation statement: myApp = new App();
New is envoked.
New operator allocates memory.
New calls the constructor.
Constructor body is not yet executed though.
New operator calls the super constructor.
Super instance variables are initialized to their defaults.
New operaator calls the original ctor.
Its instance variables are initialized to their defaults.
Constructor body is now executed.
Is this a good "loose" interpretation?
I'm trying to get a simpler idea on order of events for now.
Please help.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Please do not double post. Responses here please.
[ March 15, 2003: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java life cycle
 
Similar Threads
the order of Java creation
Constrcutors!
java life cycle in kindergarden form?
simpler java creation help please!
very hard question