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