Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

What means static { ... } ?

807598May 4 2006 — edited May 4 2006
In a class I have found this:
public class xxx {
	private static List yyy;
	private static int zzz;

	static { // <- i don't understand this one...
		init();
	}
/* other code here */
}
I've never found static used in this way, what's mean? when that portion of code will be executed?
Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 1 2006
Added on May 4 2006
2 comments
147 views