Notice
Recent Posts
Recent Comments
Link
목록공부 (1)
지니의 연대기
자바#02 / 객체와 this, static 예약어 활용
블로그 작업장 this 예약어 this는 간단하게 생성된 인스턴스 스스로를 가리키는 예약어 이다. class Birthday { int day; int month; int year; public void setYear(int year){ this.year = year; // bday.year = year과 같음. } public void showThis(){ System.out.println(this); // System.out.println(bday) 와 같음. } } public class ThisExample{ public static void main(String[] args) { Birthday bDay = new Birthday(); bDay.setYear(1996); System.out.pr..
개발공부
2021. 8. 7. 14:58