go 类型练习
来源:互联网 发布:臭臭ddos软件 编辑:程序博客网 时间:2024/06/05 05:56
package mainimport ( "fmt" "math")type rect struct { width, height float32}type cir struct { r float32}type myInt int64func (a myInt) area() myInt { return a}func (a *rect) area() float32 { a.height = 12 return (*a).height * (*a).width}func (a cir) area() float32 { a.r = 1 return (a).r * (a).r * math.Pi}func main() { r1 := rect{10, 10} r2 := cir{10} r3 := myInt(999) fmt.Println(r1.area()) fmt.Println(r2.area()) fmt.Println(r3.area()) fmt.Println("Hello World") fmt.Println(r1.height) fmt.Println(r2.r)}
0 0
- go 类型练习
- Go 练习
- Go 练习
- go练习:Web 爬虫
- 练习go基础语法
- Go语言练习
- Go获取类型底层类型
- go - 内置基础类型
- go - struct类型
- Go-类型断言
- go struct 类型
- go 类型、变量、常量
- Go语言变量类型
- go语言学习-类型
- go类型断言
- go布尔bool类型
- go语言基本类型
- Go语言程序设计:集合类型
- Jedis使用+jedis再封装
- springmvc+bootstrap风格的树形地区
- 安装指南 -- Mac 安装win10
- iOS手势识别(双击、捏、旋转、拖动、划动、长按)详解
- 第十五周项目 程序填空(3) 自定义类实现add
- go 类型练习
- C语言实现矩阵乘法
- 最大熵模型(不断更新中)
- iOS提交AppStore后申请加急审核
- C++中谈重载、覆盖、和隐藏
- UniversalMusicPlayer 学习笔记(一)
- 操作系统中常见的进程调度算法
- c++崩溃
- apache commons fileupload 概述(2016-05-27更新)