public class Main { public static void main(String[] args) { int a; ◀︎---------- 변수 선언만 한 상태 int b = 10; ◀︎----- 변수 선언과 동시에 초기화 System.out.println(a); System.out.println(b); } }
a 변수에 값을 넣고 다시 실행해보면 a, b 변수에 저장한 값이 각각 출력됩니다.