首页 > 代码库 > car demo

car demo

class

Car {

 

String color = "red";

int num = 4;

 

void run() {

System.out.println("Color" + color);

}

 

}

 

class

CarDemo {

 

public static void main(String[] args){

 

Car c=new Car();

 

c.color = "green";

c.num = 5;

 

c.run();

}

 

 

 

 

}

car demo