Bible, Lee, Data
Faith, software, data, and everyday life.
memoryAll posts
What Does a C Pointer Store, and What Does Dereferencing Actually Change?
The most confusing part of learning pointers is rarely the amount of code involved. The example above contains only two lines, yet x, &x, p, *p, and &p all mean different things.Trying to memorize each expression as an isolated syntax rule tends to work only until pointers appear alongside arrays, functions, or structures. A more reliable approach is to begin with the objects that exist in memor..
[Java] static 멤버와 메서드의 활용 및 주의점
💡static 키워드란? Java에서 static 키워드는 클래스에서 공유되는 변수나 메서드를 정의할 때 사용하며, 메모리에 한번 할당되고 나면 프로그램이 종료될 때 해제된다. static 변수를 남발하면 메모리 관리에 문제를 일으킬 수 있으므로 신중하게 사용해야 한다. 과도한 static 멤버의 사용은 프로그램의 성능을 저하시키고, 메모리 누수의 원인이 될 수 있다. static 변수는 메모리에 고정적으로 할당되어 프로그램이 종료될 때 해제되는 변수이며, static 메서드는 객체 생성 없이 호출이 가능한 메서드라고 할 수 있다. 그리고 상태를 가지고 있지 않은 단순히 메서드만 가지고 있는 구조라고 볼 수 있는데, 이러한 이유로 인해 객체지향에 벗어난 개념이 되어 일부 좋지 않은 시선도 있는 편이다. ..