Question: Given this Star class: public class Star { private double x,y; private String name; private double brightness; public Star() { name=; } public Star(String s)
Given this Star class:
public class Star { private double x,y; private String name; private double brightness; public Star() { name=""; } public Star(String s) { name = s; } public Star(String s, double b) { name = s; brightness = b; } public Star(String s, double x1, double y1) { name = s; x = x1; y = y1; } public Star(String s, double b, double x1, double y1) { name = s; x = x1; y = y1; brightness = b; } public double getX() { return x; } public void setX(double x) { this.x = x; } public double getY() { return y; } public void setY(double y) { this.y = y; } public String getName() { return name; } public void setName(String name) { this.name = name; } public double getBrightness() { return brightness; } public void setBrightness(double brightness) { this.brightness = brightness; } } How many constructors methods are there?
a. 8
b. 5
c. 4
d. 1
thanks for helping! have a happy holidays.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
