Merge pull request #184 from wuwj-cn/master

Update 02.6.md
This commit is contained in:
astaxie
2013-04-14 06:31:28 -07:00

View File

@@ -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。