mardi 19 mai 2015

Trouble with passing a random object as an argument JAVA

I am having trouble passing a random object as an argument...

I made a new file to test it and I got the same errors. Can anyone tell me what is wrong with this?


import java.util.*;
public class Practice {
    public static void main(String[] args) {
        Random r = new Random(1234);
        Spring (Random r);
}
  void Spring (Random r) {
      r.nextInt(20);
}
}


All help appreciated. Thanks.




Aucun commentaire:

Enregistrer un commentaire