import java.io.*;
/*contoh menggunakan class bufferedreader*/
public class InputFromKeyboard
{
public static void main (String[]args){
try {
String nDepan ;
String nBelakang;
BufferedReader in new BufferedReader (new InputStreamReader (System.in));
System .out.print ("masukan nama depan : ");
nDepan = in.readLine ();
System.out.print ("masukan nama belakang : ");
nBelakang = in.readLine();
System.out.println();
System.out.println("selamat datang "+nDepan+" "+nbelakang);
}catch {Exception e){
System.out.println(e);
}}}
/*contoh menggunakan class bufferedreader*/
public class InputFromKeyboard
{
public static void main (String[]args){
try {
String nDepan ;
String nBelakang;
BufferedReader in new BufferedReader (new InputStreamReader (System.in));
System .out.print ("masukan nama depan : ");
nDepan = in.readLine ();
System.out.print ("masukan nama belakang : ");
nBelakang = in.readLine();
System.out.println();
System.out.println("selamat datang "+nDepan+" "+nbelakang);
}catch {Exception e){
System.out.println(e);
}}}
0 comments