go 常量和变量基本使用
常量基本使用:
1.常量使用const 修饰,代表永远是只读的,不能修改
2. const 只能修饰boolean,number(int相关类型、浮点类型、complex)和string。
3. 语法:const identifier [type] = value,其中type可以省略。
变量基本使用:
1.语法:var identifier type
small_lei_it 技术无止境,追求更高。
常量基本使用:
1.常量使用const 修饰,代表永远是只读的,不能修改
2. const 只能修饰boolean,number(int相关类型、浮点类型、complex)和string。
3. 语法:const identifier [type] = value,其中type可以省略。
变量基本使用:
1.语法:var identifier type