- 使用Scanner類
- 使用BufferReader類
public class InputMethod {
public static void main(String args[]) throws IOException {
//1. use Scanner
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
float b = sc.nextFloat();
String c = sc.next();
//2. use BufferedReader
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String str = bf.readLine();
int s = bf.read();
}
}