int age = 20;
double pi = 3.14;
char c = 'A';
String greeting = "안녕하세요";
boolean flag = true;
byte x1 = 127;
short x2 = 32767;
int x3 = 2147483647;
long x4 = 9223372036854775807L;
float f1 = 3.14F; // 4byte
double f2 = 3.14; // 8byte
char c1 = 'A';
char c2 = 44034;
boolean b1 = true;
boolean b2 = false;
boolean b3 = 10 < 5;
int x1 = 10;
if (true) {
int x2 = 20; // x2는 여기서만 유효
}
byte a = 100;
int b = a; // byte -> int (자동)
int c = 1000;
byte d = (byte) c; // int -> byte
byte b1 = 100;
byte b2 = 70;
int result = b1 + b2;
System.out.println("Hello");
System.out.printf("오늘은 %d월 %d일입니다.\n", month, day);
Scanner scanner = new Scanner(System.in);
String name = scanner.nextLine();
int age = Integer.parseInt(scanner.nextLine());
int[] numbers = new int[5];
numbers[0] = 50;
for (int i = 0; i < numbers.length; i++) {...}
for (int n : numbers) {...}
Arrays.stream(numbers).forEach(...);
✅ 총정리