CODING:
import java.io.*;
public class file2 {
public static void main(String[] args)throws IOException {
byte b[]={'a','b','c','d'};
File f=new File("Demo2.txt");
FileOutputStream out=new FileOutputStream(f);
out.write(b);
out.close();
FileInputStream in = new FileInputStream(f);
int ch=0;
while((ch=in.read())!=-1){
System.out.println((char)ch);
}
}
}
public class file2 {
public static void main(String[] args)throws IOException {
byte b[]={'a','b','c','d'};
File f=new File("Demo2.txt");
FileOutputStream out=new FileOutputStream(f);
out.write(b);
out.close();
FileInputStream in = new FileInputStream(f);
int ch=0;
while((ch=in.read())!=-1){
System.out.println((char)ch);
}
}
}
Comments
Post a Comment