简体   繁体   English

F#构造函数

[英]F# Constructor

How do I do things in a constructor in F#? 如何在F#中的构造函数中执行操作? I cant quite figure it out... 我无法弄明白......

I would check out Constructors (F#) : 我会查看构造函数(F#)

Objects of class types have constructors. 类类型的对象具有构造函数。 There are two kinds of constructors. 有两种构造函数。 One is the primary constructor, whose parameters appear in parentheses just after the type name. 一个是主构造函数,其参数显示在类型名称后面的括号中。 You specify other, optional additional constructors by using the new keyword. 您可以使用new关键字指定其他可选的其他构造函数。 Any such additional constructors must call the primary constructor. 任何此类附加构造函数都必须调用主构造函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM