class robot{
String status;
double speed;
double temperature;
void checktemperature(){
if(temperature>600){
speed=5;
status="return home!";
}
}
void showattitude(){
System.out.println("status:"+status);
System.out.println("speed:"+speed);
System.out.println("temperature"+temperature);
}
public static void main(String[] args){
robot henry=new robot();
henry.status="exploring";
henry.speed=3.33;
henry.temperature=300.2;
henry.showattitude();
System.out.println("increase his temperature to 700.333");
henry.showattitude();
System.out.println("check his temperature");
henry.checktemperature();
henry.showattitude();
}
}为什么运行不了呢?
------解决方案--------------------
我运行的好好的
------解决方案--------------------