class Demo {
public static void main(String[] args) {
Car s=new Car();
car(s);
for (int i=0;i<10 ; i++){
System.out.println(car (s));
}
}
public static Car car(Car s){
s.color="red";
s.num=8;
s.run();
return s;
}
}
class Car {
String color;
int num;
public void run(){
System.out.println(color+"..."+num);
}
}
我帮你改了一下, 这样就对了.记得编码最好记得标识符的大小写~ |