拼写错误, YonggChap -> YongChap, 与示例代码保持一致
This commit is contained in:
@@ -83,7 +83,7 @@ interface类型定义了一组方法,如果某个对象实现了某个接口
|
||||
SpendSalary(amount float32)
|
||||
}
|
||||
|
||||
通过上面的代码我们可以知道,interface可以被任意的对象实现。我们看到上面的Men interface被Human、Student和Employee实现。同理,一个对象可以实现任意多个interface,例如上面的Student实现了Men和YonggChap两个interface。
|
||||
通过上面的代码我们可以知道,interface可以被任意的对象实现。我们看到上面的Men interface被Human、Student和Employee实现。同理,一个对象可以实现任意多个interface,例如上面的Student实现了Men和YongChap两个interface。
|
||||
|
||||
最后,任意的类型都实现了空interface(我们这样定义:interface{}),也就是包含0个method的interface。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user