Program Inputan Keyborad dengan menggunakan Bufferedreader

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class soal_pertama{
public static void main (String args[]){

String a;
String b;

try{
System.out.println(“Masukan nama anda :”);
BufferedReader apa = new BufferedReader (new InputStreamReader (System.in));
a = “”;
a = apa.readLine();

System.out.println(“Masukan alamat anda :”);
BufferedReader opo = new BufferedReader (new InputStreamReader (System.in));
b =””;
b = opo.readLine();

System.out.println(“Nama anda adalah =” +a);
System.out.println(“Alamat anda adalah =” +b);

}catch (IOException e){
System.out.println(“Error!”);

}
}
}

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: