PRO192_-_C1_-_FE_-_SU_2023_391.webp
H

PRO192_-_C1_-_FE_-_SU_2023_391.webp

OD
(Choose 1 answer)
}
}
What is the output of the following program?
class Van {
String driver; int rate;
Van() { driver="unknown"; rate = 5; }
Van(String driver, int rate) {
this.driver-driver; this.rate=rate;
}
public String toString() {return(driver+","+rate);}
}
class SpecVan extends Van {
int type:
SpecVan() {}
SpecVan(String driver, int rate, int type) {
super(driver, rate);this.type=type;
} void display() {
String s = "("+super.toString()+","+type+") ";System.out.println(s);
}
public class Main {
public static void main(String[] args) {
SpecVan x = new SpecVan();SpecVan y = new Spec Van ("Hoa", 20, 10);
x.display(); y.display();System.out.println();
A. (unknown,5,5)
(Hoa, 20,10)
B. (null,0,0)(Hoa,20,10)
C. (null,0,5)
(Hoa,20,10)
D. (null,5,5)
(Hoa,20,10)
4

Thông tin

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

Image metadata

Filename
PRO192_-_C1_-_FE_-_SU_2023_391.webp
File size
76.3 KB
Dimensions
1713px x 893px

Share this media

Back
Bên trên Bottom