Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please Explain, Thanks. Given the class Point which has two member variables x, and y. What are x and y for Point object P1 after
Please Explain, Thanks.
public class Point t private int x; private int y: public void setx(int x) this.xX public void sety(int y) this.y-y public void setxy(int x, int y) x-y: public boolean IsEqual (Point P) return ((p.xx) 8 (p.y . y)): public void DisplayPoint) System.out.printin(x+ y public void movePoint(int deltax, int deltay) / xis increased by geltax and y is increased by deltay public void SetLocation(Point P) (//make point to have the specified location P. public static void main(Stringt) args) // TOD0 Auto-generated method stub Point P1 new Point); Point P2 new Point): P1.setx(5); P1.sety(6): P2.setx(5); P2.sety(6): System.out.println(P1.IsEqual(P2)); P2.setXY(3,4): System.out.println(P1.IsEqual(P2)) Given the class Point which has two member variables x, and y. What are x and y for Point object P1 after the end of the main method?
A) x = 5, y = 5
B) x = 6, y = 5
C) x = 5, y = 6
D) x = 6, y = 6
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started