More actions
imported>Unknown No edit summary |
(Repair batch-0002 pages from live compare) |
||
| Line 19: | Line 19: | ||
|- | |- | ||
| 창재 & 수민 Pair | | 창재 & 수민 Pair | ||
| | | JavaStudy2003.zip | ||
|} | |} | ||
Revision as of 00:16, 27 March 2026
오버로딩(Overloading) 및 리팩토링
- 오버로딩 - C++에서 cin을 cin.get(), cin.get(ch), cin.get(ch,50) 이렇게 쓰는 것처럼 같은 이름의 함수로 비슷한 기능의 역할을 하는 함수들을 만들었다.
public Circle(int xValue, int yValue, int width, int height) {
middlePoint = new Point(xValue, yValue);
this.width = width;
this.height = height;
}
public Circle(int xValue, int yValue, int r){
middlePoint = new Point(xValue, yValue);
this.width = r;
this.height = r;
}
- 또 Point(int xValue, int yValue) -> 같이 전달인자를 바로 넣어주어서 보다 간편하게 자료를 입력받을 수 있게 했다.
| 창재 & 수민 Pair | JavaStudy2003.zip |