https://seonggongstory.tistory.com/207 static(전역) 변수와 메모리 영역 메모리의 영역엔 stack heap data code의 영역이 있고 stack엔 지역변수와 매개변수처럼 호출시 사용되는 저장영역이다. 호출이 끝나면 그대로 소멸 heap의 영역은 사용자가 관리하며 메모리 공간이 동 seonggongstory.tistory.com static int count =1; int data =0; 일반 변수 앞에 static전역 변수 설정하면 두개의 독립된 객체변수에서 sv1.count = 3; 이런식으로 count값을 바꿨을경우 원래대로면 sv2 값은 그대로 지만 전역 변수 세팅시 sv1과 sv2가 같이 바뀌게 된다