public class Point private int x; private int y public void setx(int x) this.xX
ID: 3745875 • Letter: P
Question
public class Point private int x; private int y public void setx(int x) this.xX public void set(int y) this.y-y public void setxY(int x, int y) x-yi public boolean IsEqual(Point p) return ((p.x =. x) && (p.y--y)); public void DisplayPoint) System.out.printin+y")") public void novepoint(int deltax, int deltay) is increased by deltax and y is increased by deltay public void Setlocation(Point P) (imake point to have the specified location P public static void nain(Stringt) args) TOO Auto-generated nethod stub Point P1new Point) Point P2- new Point) P1.setx(s); P1.sety(6); P2.setx(5); P2.sety(6); System.out.printin(P1.IsEqual (P2)) P2.setXY(3,4) Systen.out.printin(P1.IsEqual(P2)) Given the class 'Point which has two member variables x, and y. What are x and y for Point object P2 after the end of the main method?Explanation / Answer
1) Ans) x=3, y=4
______________
2)Ans)
public in getMonth()
{
}
public String getMonth(int aMonth)
{
}
These two methods are not overloaded because ,the return type of first person is int and the return type of the second method is String
_____________Thank You
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.