fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. double boatYear = inputBoatYear("Please enter the boat year, must >= 1800 and <= 2014:", 1800, 2014);
  13. }
  14.  
  15. public static int inputBoatYear(String messagePassed,int lowerLimitPassed, int upperLimitPassed)
  16. {
  17. System.out.println(messagePassed);
  18. int userInput = keyboard.nextInt();
  19.  
  20. do{
  21. System.out.println("Please Reenter the year: ");
  22. userInput = keyboard.nextInt();
  23. }
  24. while(userInput < lowerLimitPassed || userInput > upperLimitPassed);
  25.  
  26. keyboard.nextLine();
  27. return userInput;
  28. }
  29.  
  30.  
  31.  
  32. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:18: error: cannot find symbol
int userInput = keyboard.nextInt();
                ^
  symbol:   variable keyboard
  location: class Ideone
Main.java:22: error: cannot find symbol
userInput = keyboard.nextInt();
            ^
  symbol:   variable keyboard
  location: class Ideone
Main.java:26: error: cannot find symbol
keyboard.nextLine();
^
  symbol:   variable keyboard
  location: class Ideone
3 errors
stdout
Standard output is empty