Pages

Kamis, 08 Maret 2012

Far Char


Ini adalah contoh project mengunakan stream IO :

package testjeni;

/**
 *
 * @author emund
 */
import java.io.*;
public class Far_Char {
    

public static void main(String args[]) throws IOException {
System.out.println("Hi, what's your favorite character?");
char favChar;
BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));
favChar = (char) br.read();
System.out.println(favChar + " is a good choice!");
}
}



*dan outputnya adalah ......



run:
Hi, what's your favorite character?
E
E is a good choice!
BUILD SUCCESSFUL (total time: 9 seconds)



0 komentar:

Posting Komentar

Twitter Delicious Facebook Digg Stumbleupon Favorites More