1 頁 (共 1 頁)

Java 輸入字元

發表於 : 2015-08-12, 02:07
tony
要使用Java.io.*套件

Example:

import java.io.*;
public class J2_4_2 {
public static void main (String[] args) throws IOException {
char ch;
System.out.print(“Please enter a letter: “);
ch = (char)System.in.read();
System.out.println(“The letter you enter is: " + ch);
}
}