自学内容网 自学内容网

go语言(十)---- 面向对象封装

面向对象的封装

package main

import "fmt"

type Hero struct {
   
Name string
Ad  int
Level int
}

func (this Hero)  Show(){
   

fmt.Println("Name = ", this.Name)
fmt.Println("Ad = ", this.Ad)
fmt.Println("Level = ", this.Level)

}

func (

原文地址:https://blog.csdn.net/weixin_41709748/article/details/135706442

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!