I wonder why this code works on nano on my Mac but not on eclipse.. I also do not understand why it does not run on eclipse although I know where the wrongs seemingly are..
public class randomnumber {
public static void main (String [] args) {
int n = integer.parseInt(args [0]);
int m = Integer.parseInt(args[1]);
random = (int) (Math.random() * (m - n + 1)+n);
System.out.println(random);
}
}
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
integer cannot be resolved
random cannot be resolved to a variable
random cannot be resolved to a variable
at Randomnumber.main(Randomnumber.java:5)
Aucun commentaire:
Enregistrer un commentaire