This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Loading means when a class is loaded. So in this case when java.io.* and java.custom.* are imported in the class, does that mean loading ? int num=20 is initializing of num
If there is s static initializer block in this code or in java.Custom, will it be executed immediately with loading of class (ie on import of class) ?
If I want to test, how can I test this ? If I want to load the class, then I will have to run this code as "java TestLoading" , and it will execute main(). So even if a static initializer block runs on loading, I will not be able to know that. Is there a way, I wan stop execution of code after loading ? Or is there a way I can just run class upto loading and not any further ?