//program input dari keyboard
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class InputdariKeyboard{
public static void main( String[] args){
BufferedReader dataIn = new BufferedReader(new InputStreamReader(System.in));
String name = "";
System.out.print("Masukan nama :");
try{
name = dataIn.readLine();
}catch( IOException e){
System.out.println("Error!");
}
System.out.println("Hello "+name+"!");
}
}
Home » Bahasa pemrograman 1 (java) »
latihan java »
program input dari keyboard
» contoh program input dari keyboard