1 public static void main(String[] args){ 2 Scanner scanner = new Scanner(System.in); //輸入流扫描器 3 System.out.println("Please enter you tel:"); 4 String line = scanner.nextLine(); 5 System.out.println("the tel length is:"+line.length()); 6 }
原文:http://www.cnblogs.com/jjlyx/p/7504283.html