Pages

Sabtu, 10 Maret 2012

Favorite Character

kalo ini nampilin karakter setelah karkter yg kita inputin dari sebuah kata (max 3 kata)..
bingung kan? kita praktekin aja :D

package testjeni;
import java.io.*;
/**
 *
 * @author Mothed
 */
public class GreetUser {
 public static void main(String args[]) throws IOException {
System.out.println("Hi, what's your name?");
String name;
BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));
name = br.readLine();
System.out.println("Nice to meet you, " + name + "! :)");
 }
}

dan, hasil outputnya adalah :
Hi, what's your favorite character?
dea
efb is a good choice!

selamat mencoba :D

0 komentar:

Posting Komentar