Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedReader;
- import java.io.InputStreamReader;
- import java.io.IOException;
- public class GetInputFromKeyboard {
- public static void main(String[] args) {
- // TODO code application logic here
- BufferedReader dataIn = new BufferedReader(new InputStreamReader(System.in));
- String nama="";
- System.out.print("Masukkan nama anda:");
- try{
- nama=dataIn.readLine();
- }catch(IOException e){
- System.out.print("Error!");
- }
- System.out.println("Hai "+nama+"!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment