首页 > 其他 > 详细

水果类

时间:2016-03-08 09:23:33      阅读:161      评论:0      收藏:0      [点我收藏+]

 

package com.hanqi;

public class shuiGuo {
private String color;
private double price;
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public double getWeight() {
return weight;
}
public void setWeight(double weight) {
this.weight = weight;
}
private double weight;
}


}
private double weight;
}

public class fruit {

public static void main(String[] args) {
shuiGuo apple=new shuiGuo();
apple.setColor("红色");
apple.setPrice(5.5);
apple.setWeight(10);
System.out.println(apple.getColor());
System.out.println(apple.getWeight());
System.out.println(apple.getPrice());

}

}

水果类

原文:http://www.cnblogs.com/lizhe313/p/5252704.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!