13-01-2010, 10:47 AM | #1 |
Member
Join Date: Dec 2009
Posts: 76
Rep Power: 15 |
What is difference between static and init block in java?
Code:
public class LoadingBlocks { static{ System.out.println("Inside static"); } { System.out.println("Inside init"); } public static void main(String args[]){ new LoadingBlocks(); new LoadingBlocks(); new LoadingBlocks(); } } Inside static Inside init Inside init Inside init |
Bookmarks |
Tags |
java |
|
|