변수 (1) 썸네일형 리스트형 [JAVA]변수의 유효범위 예제 1234567891011121314151617181920 package org.opentutorials.javatutorials.scope; public class ScopeDemo6 { static int i = 5; static void a() { int i = 10; b(); } static void b() { System.out.println(i); } public static void main(String[] args) { a(); } }Colored by Color Scriptercs 변수의 유효범위에 대한 예제입니다. 해당 소스를 실행 했을때 출력되는 숫자는 5일까요 10일까요?출처:https://opentutorials.org 이전 1 다음