day01-java中的基本数据类型(重点)
This commit is contained in:
18
day01/src/com/inmind/Demo03_Var.java
Normal file
18
day01/src/com/inmind/Demo03_Var.java
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
package com.inmind;
|
||||||
|
/*
|
||||||
|
四类八种基本数据类型:
|
||||||
|
|
||||||
|
数据类型 关键字 内存占用 取值范围
|
||||||
|
字节型 byte 1个字节 -128~127
|
||||||
|
短整型 short 2个字节 -32768~32767
|
||||||
|
整型 int(默认) 4个字节 -231次方~2的31次方-1
|
||||||
|
长整型 long 8个字节 -2的63次方~2的63次方-1
|
||||||
|
单精度浮点数 float 4个字节 1.4013E-45~3.4028E+38
|
||||||
|
双精度浮点数 double(默认) 8个字节 4.9E-324~1.7977E+308
|
||||||
|
字符型 char 2个字节 0-65535
|
||||||
|
布尔类型 boolean 1个字节 true,false
|
||||||
|
|
||||||
|
注意:Java中的默认类型:整数类型是int 、浮点类型是double 。
|
||||||
|
*/
|
||||||
|
public class Demo03_Var {
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user