PRO192_-_FA_2023_-_RE_1159.webp
Hoàng Nam

PRO192_-_FA_2023_-_RE_1159.webp

(Choose 1 answer)
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();
}

Exit 16

Thông tin

Category
PRO192
Thêm bởi
Hoàng Nam
Ngày thêm
Lượt xem
4,526
Lượt bình luận
14
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PRO192_-_FA_2023_-_RE_1159.webp
File size
62.2 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom