class Phone{
private double weight;
private double length;
private double width;
private double high;
private int worth;
private String brand;
private String version;
private String monitor;
private String net;
private int ram;
public double getWeight(){
return weight;
}
public void setWeight(double weight){
this.weight=weight;
}
public double getLength(){
return length;
}
public void setLength(double length){
this.length=length;
}
public double getWidth(){
return width;
}
public void setWidth(double width){
this.width=width;
}
public double getHigh(){
return high;
}
public void setHigh(double high){
this.high=high;
}
public int getWorth(){
return worth;
}
public void setWorth(int worth){
this.worth=worth;
}
public String getBrand(){
return brand;
}
public void setBrand(String brand){
this.brand=brand;
}
public String getVersion(){
return version;
}
public void setVersion(String version){
this.version=version;
}
public String getMonitor(){
return monitor;
}
public void setMonitor(String monitor){
this.monitor=monitor;
}
public String getNet(){
return net;
}
public void setNet(String net){
this.net=net;
}
public int getRam(){
return ram;
}
public void setRam(int ram){
this.ram=ram;
}
public void show(){
System.out.println("品牌:"+brand);
System.out.println("版本:"+version);
System.out.println("长度:"+length+"mm");
System.out.println("宽度:"+width+"mm");
System.out.println("高度:"+high+"mm");
System.out.println("重量:"+weight+"g");
System.out.println("价格:"+worth+"¥");
System.out.println("主屏参数:"+monitor);
System.out.println("网络制式:"+net);
System.out.println("内存容量:"+ram+"M");
}
}
import.java.util.*;//编译在这里报错,缺少class interface或enum
class Nokia{
public static void main(String[]agrs){
Phone p=new Phone();
p.setBrand("Nokia");
p.setVersion("7210C Series 40 5th Edition, Feature Pack 1");
p.setWorth(850);
p.setLength(106.0);
p.setWidth(45.1);
p.setHigh(10.6);
p.setWeight(88.8);
p.setMonitor("26万色,QVGA,240×320像素,2.0英寸");
p.setNet("GSM 900/1800/1900,EDGE");
p.setRam(30);
p.show();
}
}