PRO192_-_SU_2023_-_Block_5_-_FE_735.webp
successful_man

PRO192_-_SU_2023_-_Block_5_-_FE_735.webp

2
(Choose 1 answer)
A. (null.5.0)(Hoa,20,10)
B. (null,0.5)(Hoa. 20,10)
C. (null.5.5)(Hoa, 20, 10)
D. Compilation fails.
}
What is the result of running the program below?
class Vase {
String color; int price;Vase() { price = 5; }
Vase(String color, int price) {
this.color-color; this.price price;
}
public String toString() {return(color+","+price);}
class SpecVase extends Vase {
int type;
SpecVase() {type=5;}
SpecVase(String color, int price, int type) {
this.type=type;
super(color,price);
}
void display() {
String s = "("+super.toString()+","+type+") ";System.out.println(s);
}
}
public class Main {
public static void main(String[] args) {
SpecVase x = new SpecVase();
SpecVase y = new Spec Vase("Hoa", 20, 10);
x.display(); y.display();System.out.println();
}

Thông tin

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

Image metadata

Filename
PRO192_-_SU_2023_-_Block_5_-_FE_735.webp
File size
64.5 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom