Answered step by step
Verified Expert Solution
Link Copied!

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.
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 image text in transcribed
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))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

3. What information do participants need?

Answered: 1 week ago