/*
描述汽车
属性:
品牌,价格,颜色
行为:
跑,停
*/
class Car
{
String pinPai;
String money;
String color;
public String run()
{
System.out.println("开着敞篷汽车去把妹子");
return "找到妹子去海边踏浪";
}
public String stop()
{
System.out.println("把车停在海边住着海景房"+"\n"+"抱着妹子");
return "你懂得";
}
}
class BaoShiJie
{
public static void main(String[] args)
{
Car c = new Car();
c.pinPai="拉风的保时捷卡宴";
c.money = "此款限量版价值不到一个亿只要:"+99999999+"元";
c.color = "最鲜艳拉风的红色";
System.out.println(c.pinPai+"\n"+c.money+"\n"+c.color);
String r = c.run();
System.out.println(r);
String s = c.stop();
System.out.println(s);
}
}
|
|