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.
posted 12 years ago
Please do not double post. Responses here please. [ March 15, 2003: Message edited by: Barry Gaunt ]