
[정보처리기사] 프로그래밍 언어 문제 풀이 (2) - 정적 변수
·
IT, Computer
서론이번에는 정처기에서 등장하는 정적 변수 관련 문제를 풀어보고자 한다. 본 문제는 2023년 1회에 나온 문제다. 본 포스팅 역시 우선 문제를 보고, 바로 어떻게 풀었는 지 적을 예정이다. 포인터에 대한 정보처리기사 문제를 풀고자 한다면 여기로 가면 된다.문제class Static { public int a = 20; static int b = 0;}public class Main { public static void main(String[] args) { int a; a = 10; Static.b = a; Static st = new Static(); System.out.println(Static.b++); System.out.println(st.b); System.out.println(a); Sys..