Minggu, 18 April 2010

Java file4

import java.io.*;

class File4{

public static void main(String[] args) {
File f;
f = new File("Latihan.txt");

try{
InputStream fs = new FileInputStream(f);

byte b[] = new byte[100];

fs.read(b);





String str = new String(b,0,b.length);


System.out.println("isi file : " + str);

fs.close();
}catch(Exception e){
}
}
}