1 Scanner in = new Scanner(System.in) 2 String s = in.next();//输入一个字符串内 3 char c = s.charAt(0);//读取字符串s的第1个字符