Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed
image text in transcribed
image text in transcribed
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; y=y; public boolean IsEqual(Point p) return ((p.x == x) && (p.y = y)); public void DisplayPoint() System.out.println("(" + x + "," + y + ")"); public void movePoint(int deltax, int deltay) Save and 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.sets(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)); System.out.println(P1. IsEqual(P2)); Given the class 'Point' which has two member variables x, and y. What will the output of the second "System.out.printin" statement in the main method ? (Pay close attention to the setXY method) Won't print anything False Error True

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

blur-text-image

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

Advances In Databases And Information Systems 25th European Conference Adbis 2021 Tartu Estonia August 24 26 2021 Proceedings Lncs 12843

Authors: Ladjel Bellatreche ,Marlon Dumas ,Panagiotis Karras ,Raimundas Matulevicius

1st Edition

3030824713, 978-3030824716

More Books

Students also viewed these Databases questions

Question

8. Describe how cultural spaces are formed.

Answered: 1 week ago