Ray's playground

 

Item 14: Minimize Duplicate Initialization Logic(Effective C#)

  Here is the order of operations for constructing the first instance of a type:
  1. Static variable storage is set to 0.
  2. Static variable initializers execute.
  3. Static constructors for the base class execute.
  4. The static constructor executes.
  5. Instance variable storage is set to 0.
  6. Instance variable initializers execute.
  7. The appropriate base class instance constructor executes.
  8. The instance constructor executes.

posted on 2011-01-24 22:33  Ray Z  阅读(166)  评论(0编辑  收藏  举报

导航