单选题:以下( )添加到ComputerBook中不会出错
以下( )添加到ComputerBook中不会出错 @[D](1)
```
class Book{
protected int getPrice(){
return 30;
}
}
public class ComputerBook extends Book{
}
```
A. protected float getPrice(){}
B. protected int getPrice(int page){}
C. int getPrice(){}
D. public int getPrice(){return 10;}
A.protected float getPrice(){}
B.protected int getPrice(int page){}
C.int getPrice(){}
D.public int getPrice(){return 10;}
答案:D
```
class Book{
protected int getPrice(){
return 30;
}
}
public class ComputerBook extends Book{
}
```
A. protected float getPrice(){}
B. protected int getPrice(int page){}
C. int getPrice(){}
D. public int getPrice(){return 10;}
A.protected float getPrice(){}
B.protected int getPrice(int page){}
C.int getPrice(){}
D.public int getPrice(){return 10;}
答案:D