Day04 数组


Scanner输入的小问题:

Scanner sc=new Scanner(System.in);
System.out.println("请输入int类型的值:");
int number = sc.nextInt();
//sc.nextLine();  接收回车键 否则2处会接收回车

System.out.println("请输入String类型的数据:");
String str=sc.nextLine();//2
System.out.println(str);


默认值
byte short int long    0
float fouble               0.0
char                          '\u0000'
boolean                    false
引用类型                    null

栈内存   局部变量 用完即回收
堆内存    new的所有对象
方法区    面向对象方法
本地方法区  系统
寄存器   CPU

猜你喜欢

转载自blog.csdn.net/quiethrh/article/details/80990261