添加Lesson17
This commit is contained in:
@@ -55,7 +55,8 @@
|
||||
//父类的父类的构造->...父类构造->...->子类构造
|
||||
class GameObject
|
||||
{
|
||||
public GameObject() {
|
||||
public GameObject()
|
||||
{
|
||||
Console.WriteLine("gameobject的构造函数");
|
||||
}
|
||||
}
|
||||
@@ -104,7 +105,7 @@
|
||||
class Son : Father
|
||||
{
|
||||
|
||||
public Son(int i):base(i)//用base来传给父类构造函数一个值
|
||||
public Son(int i) : base(i)//用base来传给父类构造函数一个值
|
||||
{
|
||||
Console.WriteLine("son 1,参数i的值{0}", i);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user