문제풀이/명품 자바 프로그래밍(개정4판)
명품 자바 프로그래밍(개정4판) 제 6장 실습문제
[1번] class MyPoint{ private int x,y; public MyPoint(int x,int y) { this.x=x; this.y=y; } public String toString() { return "Point("+x+","+y+")"; } public boolean equals(MyPoint p) { return this.x==p.x&&this.y==p.y; } } public class p0601 { public static void main(String[] args) { // TODO Auto-generated method stub MyPoint p=new MyPoint(3,50); MyPoint q=new MyPoint(4,50); System.out.println(p); i..
2020. 11. 22.