文章列表
作业1:
package MyPackage;
class book {
private String name;
private double price;
public book(String name,double price){
this.name=name;
this.price=price;
}
public void setName(String name){
this.name=name;;
}
public void setPrice(double price){
this.price=price;;
}
...
类的多态接口与抽象类的练习
- 博客分类:
- JAVA
interface Tiji{
public abstract void meng();
}
abstract class Chenchen {
abstract double getS();
abstract double getV();
void printSV(){
System.out.println("表面积:"+getS());
}
}
class Diandian extends Chenchen implements Tiji{
double r,h;
Diandian(double x,doubl ...