Question: 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

 Given the class 'Point' which has two member variables x, and

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 ?

True

False

Won't print anything

Error

public class Point f private int x; private int y; public void setX(int x) this.x -x; public void setY(int y) this.yey; public void setXY(int x, int y,) x-y; public boolean IsEqual (Point p) public void DisplayPoint() System.out.println("("+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) t /I 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))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!