Using the method overload method to reuse code to complete the following functions
1. Define methods for getting console input integers
Return value: The integer entered
2. Define get console input integer, method with specified hint
Parameters: Prompt Content
Return value: The integer entered
3. Defines a method for obtaining a console input integer, with a specified hint, with a specified range (between the minimum and maximum values),
Method must return the input integer between the minimum and maximum values
Parameters: Hint content, range minimum, range maximum
Return value: The integer entered
4 test the above method in Main method
Import Java.util.Scanner;
public class test1{public
static void Main (String args[]) {
int max=50;
SYSTEM.OUT.PRINTLN ("Input 20-50 Integer:" +inputint ("Input 20-50 integer", 20,50));
}
public static int Inputint () {
String defaulttishi= "Please enter int integer";
int In=inputint (Defaulttishi);
return in;
}
public static int Inputint (String tisi) {
Scanner sc=new Scanner (system.in);
System.out.println (Tisi);
int In=sc.nextint ();
return in;
}
public static int Inputint (String tisi,int min,int max) {while
(true) {
int in=inputint (tisi);
if (In>=min&&in<=max) {return in
;
}
}
}