我有一个C#
有两个构造函数的类
public class GObject {
public GObject(){
// The default constructor
}
public GObject(int xPos, int yPos){
// Second constructor
}
}
编写这样的子类是否有效Block
?
public class Block : GObject {
// Sub class methods go here, no special constructor
}
Block
并用第二个构造函数实例化?
Block myBlock = new Block(10, 15);