这个属性在建构函式中设定。
以下是一个类别使用私用建构函式的范例。
The following is an example of a class using a private constructor.
请注意,原始程序码中没有预设建构函式。
Notice that there is no default constructor in the source code.
出现建构函式意味著此型别不是静态型别。
The presence of the constructor suggests that the type is not a static type.
基底类别的建构函式必须在衍生类别中呼叫。
The constructor for the base class must be called in the derived class.
否则当您尝试使用建构函式时,会掷回例外状况。
If you do, an exception is thrown when you try to use the constructor.
例如,属性无法在建构函式的初始化清单中初始化。
A property cannot be initialized, for example, in a constructor's initialization list.
或是可以在所有建构函式呼叫的初始设定方法中宣告。
Or you could declare it in an initialization method that is called by all constructors.
当您想要传递错误讯息给使用者时,可以使用此建构函式。
Use this constructor when you want to pass an error message to the user.
用函式库函式的形式建构语言的重大部分。
This lets us build a significant piece of the "language" as library routines.
用函式库函式的形式建构语言的重大部分。
This lets us build a significant piece of the "language" as library routines.
应用推荐