package main
import "fmt"
//先定义接口
type Humaner interface {
Say() //只定义不实现
}
type Student struct {
name string
age int
}
func (s *Student) Say() {
fmt.Printf(s.name, s.age)
}
func main() {
var h Humaner
//对象创建
stu := Student{"wang", 18}
//将对象信息赋值给接口类型变量
h = &stu
h.Say()
}