接口(Interface) 3) 没有定义任何构造函数。如果有,也不含参数,并且为protected; 优点:以Interface为后缀可令他人知道不能为该接口类增加实现函数或非静态数据成员,这一点对于多重继承尤其重要。
基于32个网页-相关网页
还有第三种可能性:元素类型可能是没有定义任何构造函数的类类型。
There is a third possibility: The element type might be of a class type that does not define any constructors.
通常在类定义中包含不带参数的构造函数没有任何意义。
Often, it just doesn't make sense to include a zeroary constructor in a class definition.
如果没有为一个类显式定义任何构造函数,编译器将自动为这个类生成默认构造函数。
If we do not explicitly define any constructors, then the compiler will generate the default constructor for us.
应用推荐