方法1:
public static void main(String[] args) throws Exception{
char c;
c = (char)System.in.read();
}
方法2:
char c;
Scanner sc = new Scanner(System.in);
c = sc.next().charAt(0);
方法1:
public static void main(String[] args) throws Exception{
char c;
c = (char)System.in.read();
}
方法2:
char c;
Scanner sc = new Scanner(System.in);
c = sc.next().charAt(0);