常量的使用与应用

| 阅读:113 发表时间:2016-12-03 20:18:23 Golang

```

package main

import "fmt"

const (
A = 10
)

type NewInt int

const Y NewInt = 10

//const y NewInt = 11 + Y

//const Y NewInt = 10
const B int = 11

const (
y int = A
x NewInt = A
m int = B
n NewInt = NewInt(B)
)

func main() {
fmt.Printf("Y = [%d] \n", Y)
}

```

热门推荐

友情连接

0.0251s