QA@IT
«回答へ戻る

390
 キー入力の基本Sampleは下記です。
 あとは...
 
+```java
 import java.io.BufferedReader; 
 import java.io.IOException; 
 import java.io.InputStreamReader; 

キー入力の基本Sampleは下記です。
あとは...

import java.io.BufferedReader; 
import java.io.IOException; 
import java.io.InputStreamReader; 

public class BufferedReaderExample { 

    public static void main(String[]args)throws IOException{ 

        InputStreamReader ISR = new InputStreamReader(System.in); 
        BufferedReader BR = new BufferedReader(ISR); 

        System.out.println("What's your name?"); 
        String userInput = BR.readLine(); 

        System.out.println("Your name is : " + userInput); 

        BR.close(); 
        ISR.close(); 
    } 

}

キー入力の基本Sampleは下記です。
あとは...

```java
import java.io.BufferedReader; 
import java.io.IOException; 
import java.io.InputStreamReader; 
   
public class BufferedReaderExample { 
       
	public static void main(String[]args)throws IOException{ 
           
		InputStreamReader ISR = new InputStreamReader(System.in); 
		BufferedReader BR = new BufferedReader(ISR); 
           
		System.out.println("What's your name?"); 
		String userInput = BR.readLine(); 
           
		System.out.println("Your name is : " + userInput); 
           
		BR.close(); 
		ISR.close(); 
	} 
       
}

回答を投稿

キー入力の基本Sampleは下記です。
あとは...

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class BufferedReaderExample {

public static void main(String[]args)throws IOException{ 

    InputStreamReader ISR = new InputStreamReader(System.in); 
    BufferedReader BR = new BufferedReader(ISR); 

    System.out.println("What's your name?"); 
    String userInput = BR.readLine(); 

    System.out.println("Your name is : " + userInput); 

    BR.close(); 
    ISR.close(); 
} 

}

キー入力の基本Sampleは下記です。
あとは...

import java.io.BufferedReader; 
import java.io.IOException; 
import java.io.InputStreamReader; 
   
public class BufferedReaderExample { 
       
	public static void main(String[]args)throws IOException{ 
           
		InputStreamReader ISR = new InputStreamReader(System.in); 
		BufferedReader BR = new BufferedReader(ISR); 
           
		System.out.println("What's your name?"); 
		String userInput = BR.readLine(); 
           
		System.out.println("Your name is : " + userInput); 
           
		BR.close(); 
		ISR.close(); 
	} 
       
}