Ads 468x60px

Selasa, 01 November 2011

coding bufferreader sederhana

import java.io.*;
public class Latihanmodul1 {
    public static void main(String[] args){
        try{

String nDepan;

BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Massukan data-data anda: ");
System.out.println();
System.out.print("Masukkan Nama Depan       : ");
nDepan = in.readLine();
System.out.print("Masukkan Nama Belakang    : ");
String nBelakang = in.readLine();
System.out.print("masukkan alamat rumah     : ");
String nAlamat = in.readLine();
System.out.print("Masukkan kota             : ");
String nKota = in.readLine();
System.out.print("Masukkan tempat lahir     : ");
String nTempat = in.readLine();
System.out.print("Masukkan Tanggal lahir    : ");
String nTanggal = in.readLine();
System.out.println();
System.out.println("======================================================");
System.out.println("                    Biodataku");
System.out.println("======================================================");
System.out.println("Nama Lengkap        : " + nDepan + " " + nBelakang);
System.out.println("Alamat              : " + nAlamat + " " + nKota);
System.out.println("Tempat tanggal lahir: " + nTempat+","+ nTanggal);

}
catch(Exception e){
System.out.println(e);
}

}
    }

0 komentar:

Posting Komentar

clock