public class Test2 {
public static void main(String[] args) {
if(args.length < 2) {
System.err.println("Error !!");
System.exit(1);
}
float distance = Float.parseFloat(args[0]);
float time = Float.parseFloat(args[1]);
System.out.print("Velocity = " );
System.out.print(distance / time);
System.out.print(" m/s ");
}
}
如何使变量保持不变?
恒定距离 = 10 ;
恒定时间 = 5 ;
谢谢大家!