I have two functions that are used to prompt and recieve input from the user. One is for int and the other is for boolean. They work somewhat similar to each other, one uses try/catch and the other doesn't. Can they be improved upon or is one better than the other? I'm having trouble with the user interface, I'm not sure what should happen when the user gives an invalid input. I asked on userexperience and didn't get much feed back./*returns integer to question asked in prompt*/public static int getNumber(String prompt){    Scanner sc = new Scanner(System.in);    while (true) {        System.out.print(\t+prompt+: );        String input = sc.next();        try {            return Integer.parseInt(input);        } catch (NumberFormatException ne) {            System.out.println(\tPlease enter an integer.);        }    }}/*returns boolean to question asked in message*/public static boolean getBool(String message){    Scanner sc = new Scanner(System.in);    String answer;    System.out.print(\t+message+: );    while (true) {      answer = sc.nextLine().trim().toLowerCase();      if (answer.equals(y)) {        return true;      } else if (answer.equals(n)) {        return false;      } else {         System.out.print(\tPlease answer y/n);      }    }}One problem is please enter an integer. If the user is non-technical they may not know what an integer is, but I can't think of better wording.Here is another version of the methods/*returns integer to question asked in prompt*/public static int getNumber(String prompt){    Scanner sc = new Scanner(System.in);    while (true) {        System.out.print(\t+prompt+: );        String input = sc.next();        try {            return Integer.parseInt(input);        } catch (NumberFormatException ne) {            System.out.println(\tPlease enter an integer.);        }    }}/*returns boolean to question asked in message*/public static boolean getBool(String message){    Scanner sc = new Scanner(System.in);    String answer;    do{      System.out.print(\t+message+ (y/n): );      answer = sc.nextLine().trim().toLowerCase();      if (answer.equals(y)) {        return true;      } else if (answer.equals(n)) {        return false;      }    }while(true);}An example of these functions being used is when they are called withpublic static void main(String[] args){    System.out.println(Please reply with y or n);     boolean celsius = getBool(Temperature in celsius);     boolean wind = getBool(Regularly windy);     System.out.println(Please enter an integer);    int minTemp = getNumber(Minimum temperature during day);     int maxTemp = getNumber(Maximum temperature during the day);     int minTempNight = getNumber(Minimum temperature during the night);     int maxTempNight = getNumber(Maximum temperature during the night);    //setup();}Example input/outputrun:Please reply with y or n    Temperature in celsius (y/n): m    Temperature in celsius (y/n): 5    Temperature in celsius (y/n): y    Regularly windy (y/n): asdf    Regularly windy (y/n): yPlease enter an integer    Minimum temperature during day: 5    Maximum temperature during the day: 20    Minimum temperature during the night: blah    Please enter an integer.    Minimum temperature during the night: 1    Maximum temperature during the night: words    Please enter an integer.    Maximum temperature during the night: 10
Making sure user inputs correct type
java;io;user interface