subject
Chemistry, 05.02.2021 21:50 jen6815

Pertain to the following class, Point: public class Point {
private double x;
private double y;

public Point() {
this (0, 0);
}

public Point(double a, double b) {
/* missing code */
}
// ... other methods not shown
}
Which of the following correctly implements the equals method?

public boolean equals(Point p) {
return (x == p. x && y == p. y );
}
public void equals(Point p) {
System. out. println(x == p. x && y == p. y);
}
public void equals(Point p) {
return (x == p. x && y == p. y );
}
public boolean equals(Point p) {
return (x == Point. x && y == Point. y);
}
public boolean equals(Point p) {
System. out. println(x == p. x && y == p. y);
}


The default constructor sets x and y to (0, 0) by calling the second constructor. What could be used to replace /* missing code */ so that this works as intended?

a = 0;

b = 0;
this (x, y);
this(0, 0);
x = a;

y = b;
a = x;

b = y;


Which of the following correctly implements a mutator method for Point?

public double getX() {
return x;
}
public void setCoordinates (double a, double b) {
x = a;
y = b;
}
None of the items listed.

public double getX() {
return a;
}
public void setCoordinates (double a, double b) {
Point p = new Point(a, b);
}

ansver
Answers: 1

Another question on Chemistry

question
Chemistry, 21.06.2019 17:00
Two friends at different locations want to communicate with each other by sending low energy signals. which of the following methods can they use to communicate? a) produce x-rays using colliding electrons and send them to radios, which capture sound b) send messages using infrared radiation, which travel in the form of waves c) send radio waves through intervening media like radio and television d) produce sound waves using microwaves from heated objects
Answers: 2
question
Chemistry, 21.06.2019 23:00
Write a brief passage describing a neutral atom of nitrogen-14 (n-14). describe the number of protons, neutrons, and electrons in the atom, where each type of particle is located, and how the terms atomic number, mass number, and atomic mass are related to the particles. use the periodic table to you. 14 protons and eletrons since its a neutral atom
Answers: 1
question
Chemistry, 22.06.2019 14:00
How many absorptions would you expect to observe in the 13c nmr spectra of the following molecules? a) 3-chloropentane b) cis-4-methyl-2-pentene
Answers: 2
question
Chemistry, 22.06.2019 23:10
What are the two major rules associated with polarity
Answers: 1
You know the right answer?
Pertain to the following class, Point: public class Point {
private double x;
private...
Questions
question
Mathematics, 27.06.2019 09:50
Questions on the website: 13722359