Monday, November 16, 2009

How to connect File in Java

How to connect File in Java, It easy to do but there are many people don't understand.

It have 4 component

let A is variable
B is variable
C is variable
D is variable
Path is directery's file

1. FileInputStream A = new FileInputStream( Path );
2. DataInputStream B = new DataInputStream( A );
3. InputStreamReader C = new InputStreamReader( B );
4. BufferedReader D = new BufferReader( C );

In 4 step, you can connect the file in java.
Finally, you must close the file with command
D.close()

1 comment: