| 니앙팽이 - 객체지향(OOP) | 2-1 | Class & Instance
·
CS/SW 공학
📕 2. 객체지향 개발📄 1. Class & Instance1). new를 통해 Instance 생성new 연산자로 인스턴스(객체)를 만든다.(메모리 heap영역에) 데이터 저장 공간을 할당받고 -> 그 공간의 참조값(해시코드)를 객체에게 반환해준다. -> 이어서 생성자를 호출한다.2). 예시class Calculator //클래스(공장) { int left, right; public void setOprands(int left, int right){ this.left = left; this.right = right; } public void sum(){System.out.println(this.left + this.right);} public void avg(){System.out.println((th..