Computers and Technology
Computers and Technology, 06.05.2020 00:11, llolo8

Consider the following class declarations.

public class Point
{
private double x; // x-coordinate
private double y; // y-coordinate

public Point()
{
x = 0;
y = 0;
}
public Point(double a, double b)
{
x = a;
y = b;
}

// There may be instance variables, constructors, and methods that are not shown.
}

public class Circle
{
private Point center;
private double radius;
/** Constructs a circle where (a, b) is the center and r is the radius.
*/
public Circle(double a, double b, double r)
{
/* missing code */
}
}
Which of the following replacements for /* missing code */ will correctly implement the Circle constructor?

I.
center = new Point();
radius = r;
II.
center = new Point(a, b);
radius = r;
III.
center = new Point();
center. x = a;
center. y = b;
radius = r;

A. III only

B. I, II, and III

C. II and III only

D. I only

II only

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 09:30, eiza666
My mom and i are moving and we don’t have wifi for the next week, i want to know if using a using a hotspot with unlimited data is better than using regular wifi. i’m considering cost, speed, and data sacrifices.
Answers: 1
image
Computers and Technology, 23.06.2019 13:30, juliajordan427
Best laptops for college [$100-$500 range]?
Answers: 2
image
Computers and Technology, 24.06.2019 01:30, Cinders13
How can you make your column headings stand out?
Answers: 1
image
Computers and Technology, 24.06.2019 06:30, meganwintergirl
Ineed to know the anwser to all these questions
Answers: 2
Do you know the correct answer?
Consider the following class declarations.

public class Point
{
private do...

Questions in other subjects:

Konu
English, 20.09.2020 08:01
Konu
Mathematics, 20.09.2020 08:01
Konu
Mathematics, 20.09.2020 08:01