Answered step by step
Verified Expert Solution
Question
1 Approved Answer
public class Point { private int x; private int y; public void setx(int x) this.x = x; public void setY(int y) this.y=y; public void setXY(int
public class Point { private int x; private int y; public void setx(int x) this.x = x; public void setY(int y) this.y=y; public void setXY(int x, int y) X=y; ysy; public boolean IsEqual(Point p) return ((p.x == x) && (p.y == y)); public void DisplayPoint() System.out.println("(" + x + " +X+ + y + ")"); public void movePoint(int deltax, int deltay) {!! 'x' is increased by deltax and y is increased by deltay public void SetLocation(Point P) {//make point to have the specified location P. public static void main(String[] args) { // TODO 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 will the output of the first "System.out.println" statement in the main method ? (Pay close attention to the setXY method) O False Error Won't print anything True
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