C# and Java static constructors
Where should be initialize the static field? If we do it non static initializer, each time when object created the static field will be initialized and that not efficient and may undo what we have done in up to that moment. The solution is to use static constructor. in Java, it is used when class is loaded and written as[it is called static block]
static{
//..something
}
but in C#, it is accomplished by real static constructor
static MyClass{
//.. do something
}
No comments yet.
Leave a comment
-
Recent
-
Links
-
Archives
- December 2009 (2)
- August 2009 (1)
- July 2009 (2)
- April 2009 (4)
- March 2009 (6)
- February 2009 (5)
- January 2009 (4)
- December 2008 (3)
- November 2008 (35)
- October 2008 (20)
-
Categories
-
RSS
Entries RSS
Comments RSS