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 (

你可能感兴趣的:(golang,开发语言,后端)