What is the .NET object life cycle?

前端 未结 9 2102
一个人的身影
一个人的身影 2020-12-29 09:05

What is the object life cycle for an object in .NET?

From what I understand it is:

  1. Object created - constructor called (if one exists)
  2. Methods
9条回答
  •  既然无缘
    2020-12-29 09:30

    A point about the constructor:

    Every class has one, as one will be generated by the compiler if you don't code it yourself. And the first thing this does (unless specified otherwise), is to call the ctor of it's parent type.

提交回复
热议问题