基本词汇day1
2021/7/11 6:09:55
本文主要是介绍基本词汇day1,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
基本词汇
注释词汇
Annotations 注解
Comments 注释
-
Block comment 块
-
Line comment 行
JavaDos 文档注释 /** */
/** *@description (描述) *@Author (作者) */
关键字
数据类型
-
primitive type 基本数据类型
-
整数类型:byte、short、int、long(long num = 30L;)
-
浮点类型:float(float num = 30.1F;)、double
-
布尔类型:boolean
-
字符类型:char
-
-
reference type 引用数据类型
-
类
-
接口
-
数组
-
数据类型扩展
整数扩展
-
进制:二进制0b 八进制0 十六进制0x
int i = 10;//十进制 int i1 = 0b10;//二进制 int i2 = 010;//八进制 int i3 = 0x10;//十六进制
浮点数扩展
-
银行业务怎么表示?
-
float 有限 离散 舍入误差 大约 接近但不等于
-
double
-
BigDecimal 数学工具类
float d = 0.1f; //0.1 double s = 1.0/10; //0.1 System.out.print(d==s); //false float num1 = 1213213123130f; double num2 = num1 + 1; System.out.print(d==s); //true
-
字符扩展
-
char 所有的字符本质还是数字,通编码(Unicode)表查找转换
char c = 'a'; System.out.print((int)c); //强制转换 c = 97;
-
转义字符 \t \n
布尔值扩展
-
boolean
boolean flag = true; if(flag){ System.out.print(flag); }
这篇关于基本词汇day1的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-10-06小米11i印度快充版ROM合集:极致体验,超越期待
- 2024-10-06【ROM下载】小米11i 5G 印度版系统, 疾速跃迁,定义新速度
- 2024-10-06【ROM下载】小米 11 青春活力版,青春无极限,活力全开
- 2024-10-05小米13T Pro系统合集:性能与摄影的极致融合,值得你升级的系统ROM
- 2024-10-01基于Python+Vue开发的医院门诊预约挂号系统
- 2024-10-01基于Python+Vue开发的旅游景区管理系统
- 2024-10-01RestfulAPI入门指南:打造简单易懂的API接口
- 2024-10-01初学者指南:了解和使用Server Action
- 2024-10-01Server Component入门指南:搭建与配置详解
- 2024-10-01React 中使用 useRequest 实现数据请求