Multiple Choices
}
(Choose 1 answer)
What is the output of the following program?
class Bird {
String place, color; int weight;
Bird() { weight=1; }
Bird(String place, String color) {
this.place=place; this.color=color; this.weight=2;
}
Bird(String place, String color, int weight) {
this.place-place; this.color=color; this.weight-weight;
}
public String toString() {
}
return("("+place+","+color+","+weight+") ");
public class Main {
public static void main(String[] args) {
Bird x, y, z;x = new Bird();
z = new Bird("Hola","blue",5);
y = new Bird("Hola","blue");System.out.print(x);}
System.out.print(y);System.out.print(z);
System.out.println();
A. (null, null, 1) (Hola, blue, 2) (Hola, blue, 5)
B. (null,null,0) (Hola, blue, 2) (Hola, blue, 5)
C. (null,null,0) (Hola, blue, 0) (Hola, blue, 5)
D. (null, null, 1) (Hola, blue, 0) (Hola, blue, 5)