使用扫描仪检查输入类型
/** from N o w J a v a . c o m**/ import java.io.*; import java.util.*; public class InputTypeChecker { public static void main(String args[]) throws Exception { System.out.print("Enter Something: "); // Write code here Scanner scan = new Scanner(System.in); if (scan.hasNextInt()) { System.out.println("This input is of type Integer."); } else if (scan.hasNextFloat()) { System.out.println("This input is of type Float."); } else if (scan.hasNext()) { System.out.println(