Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.io.*;
- class Main{
- public static void main(String args[]){
- int n=0;
- try{
- FileInputStream fis=new FileInputStream("D:\\doe\\code\\java\\File_Handling\\myfile.txt");
- // FileOutputStream fos=new FileOutputStream("D:\\doe\\code\\java\\File_Handling\\output.txt");
- n=fis.read();
- while((n=fis.read())!=-1){
- System.out.print((char)n);
- }
- fis.close();
- // fos.close();
- } catch(Exception e){
- System.out.println("EXCEPTION");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement