PRO192_-_SP_2024_-_Block_5_-_FE_1921.webp
K

PRO192_-_SP_2024_-_Block_5_-_FE_1921.webp

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)

Thông tin

Category
PRO192
Thêm bởi
Kurourushi89
Ngày thêm
Lượt xem
5,043
Lượt bình luận
18
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom