Package com.faintbear; import java.io. *;
class Input {// Read a Sring from kedboard public static String getString () {String string = ""; BufferedReader br = new BufferedReader (new InputStreamReader (System.in)); try {string = br.readLine ();} catch (OoException IOX) {system.err.println (IOX);} Return String;
While (True) {string string = getString (); // reads the next line of text from the input stream
// Check thein (String.Length ()> 1) {System.err.Println ("Sorry, You Should Input a Character,"); System.err.Println ("Please Input Again"; Continue;} Else {cookie = String.Charat (0); return cookie;}}}}}} // read a double number from keyboard public static double getdouble () {Double Cookie;
while (true) {String string = getString (); try {cookie = Double.parseDouble (string); return cookie;} // Check the number catch (NumberFormatException nfe) {System.err.println ( "Sorry, this is not A Double Number, Plz Input Again "); Continue;}}} //}}}} //}} {Int cookie; while (true) {string String = getString (); try {cookie = integer .PARSEINT (STRING); Return cookie;} // check the input number catch (NumberFormatexception NFE) {system.e Rr.Println ("Sorry, This Is Not a Integer Number, Plz Input Again"; Continue;}}} // Read A Float Number from Keyboard Public Static Float getFloat () {float cookie; while (true) {string string = getString (); try {cookie = Float.parseFloat (string); return cookie;} // Check the input number catch (NumberFormatException nfe) {System.err.println ( "Sorry, this is not a float number, plz input "); continued;
}}}}
Package com.faintbear; import com.faintbear.input; public class class1 {public static void main (string [] args) {system.out.println ("Please enter data"); system.out.println ("*** **************** "); int kk = INPUT.GETINT (); system.out.println (" l1 ===== " kk);}}