1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * 변수의 영역(scope) : 변수의 값이 보존되는 범위
 *  - 전역변수 = 클래스변수(필드)
 *  - 지역변수
 *  
 * 초기화 : 변수에 처음값을 부여하는 행위
 * */
public class Exam_08 {
    
    static int x;
    
    public static void main(String[] ar){
        int y = 0;
        
        System.out.println("x = " + x);
        System.out.println("y = " + y);
    }
    
}
 
cs


+ Recent posts