일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- filter()
- summarize()
- mutate()
- 대칭형 알고리즘
- groupe_by()
- AES
- dplyr
- samp;e_frac()
- select()
- proc contents
- distinct()
- sample_n()
- arrange()
Archives
- Today
- Total
Gae Ko's Blog
[JAVA] this 와 this() 본문
>> this
자신을 참조하는 참조변수. class내에서만 사용가능
매개변수와 필드 변수의 이름이 같은 경우에 구별하기 위한 목적으로 필드변수를 가리키는 때에 사용
>> this( )
생성자가 중복되어 있는 경우에 같은 클래스 내의 다른 생성자를 호출할 때 사용
반드시 첫번째 문장에 와야함
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | class MyDate { private int year; private int month; private int day; public MyDate(int year, int month){ this.year = year; this.month = month; } public MyDate(int day) { this(year, month); // '{' 다음에 위치해야한다. / 위의 year,month를 불러온다. this.day = day; } public void print() { System.out.println(year + "/" + month + "/"); } } | cs |
'프로그래밍언어 > JAVA' 카테고리의 다른 글
[JAVA] 참조? (1) | 2018.03.17 |
---|---|
[JAVA] 정적변수와 정적메소드 (static) (0) | 2018.03.12 |
[JAVA] 생성자(constructor) (0) | 2018.03.12 |
11월 21일 (0) | 2017.11.22 |
main 메소드 (0) | 2017.11.14 |