fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. /* The class name doesn't have to be Main, as long as the class is not public. */
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. int vv = random(10, 20);
  9. while(vv == 13) {
  10. System.out.println(Integer.toString(vv));
  11. }
  12. }
  13. public int random(int min, int max) {
  14. int v;
  15. java.util.Random rand = new java.util.Random();
  16. v = (int)(rand.nextInt(max) + 1);
  17. if(v < min) {
  18. random(min, max);
  19. }
  20. return(v);
  21. }
  22. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:8: non-static method random(int,int) cannot be referenced from a static context
	int vv = random(10, 20);
	         ^
1 error
stdout
Standard output is empty