您的位置:首页 > 编程语言 > Java开发

test7.8

2015-09-25 15:01 405 查看
class Fruit

{
String color;
Fruit(String c){color=c;System.out.println("Color is "+color);}

}

public class Orange extends Fruit{
String shape;

Orange(){super("yellow");System.out.println("Orange is yellow");}

Orange(String c,String s)

{super(c);shape=s;System.out.println("Orange is "+c+" and "+s);}
public static void main(String[] args) {
Orange or=new Orange();
Orange org=new Orange("Golden","oval");
}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Java