我叫王凯
侠客
侠客
  • 注册日期2013-06-24
  • 发帖数16
  • QQ1197697163
  • 火币155枚
  • 粉丝0
  • 关注1
阅读:3175回复:0

大家快来帮我看看这个程序怎么错了

楼主#
更多 发布于:2015-02-14 18:03
class Plant{
 public String shape="椭圆形";
 private static String color="白色";
 private String grow="黑土地";
 public static void main(String[] args){
  Friut f=new Friut();
  f.print();
  new Apple().main(args);
 }
 static class Fruit{
  String taste;
  boolean iron;
  Friut(){
   this.taste="酸";
   this.iron=true;
  }
  System.out。println("叶子的形状:"+new Plant().shape);
  System.out.println("花的颜色"+color);
  System.out.println("生长的环境"+new Plant().grow);
 }
}
public class Apple extends Plant.Fruit{
Apple(String taste){
 this.taste=taste;
}
Apple(){
 super();
}
public static void main(String[] args){
 Apple apple=new Apple();
 System.out.println("水果的味道:"+apple.taste);
 System.out.println("是否有何:"+apple.iron);
}
}

喜欢0 评分0
游客

返回顶部