123jgh

导航

 
public class Demo01 {
public static void main(String[] args) {
//字符
char name='国';

//字符串,string不是关键字是类
String a="hello";

//整数
int num1=15;//4字节,最常用,-2147483648-2147483647
byte num2=20;//1字节,-128-127
short num3=30;//2字节,-32768-32767
long num4=30L;//8字节,long类型要在数字后面加个L,-9223372036854775808-9223372036854775807

//小数:浮点数
float num5=68.1F;//float类型要在数字后面加个F
double num6=3.1415697849;

//布尔值,占1位
boolean flag=true;
boolean fLag=false;

System.out.println();
}
}
/*11001100是一个八位(bit)二进制数
1字节(B=byte)=8位(bit) 1024B=1KB 1024KB=1M 1024M=1G 1024G=1TB
字符:计算机中使用的字母、数字、符号、字
*/
posted on 2022-10-12 15:36  江江要努力  阅读(24)  评论(0)    收藏  举报