Twitter Update

Using Fileoutputstream java programming [JAVA]


Here I create program in java with fileoutputstream where we can write data to the other application. Here I create write to the notepad with *txt format. This is the Code :


package fileoutputstream;
import java.io.*;
public class Main {
 public static void main(String[] args) throws IOException {
    FileOutputStream f=new FileOutputStream("File.txt");
    PrintStream d=new PrintStream(f);
   
    d.println("----------------------------------------");
    d.print("nama           Alamat        telepon");
    System.out.println("Write succesfully");
        d.close();
        f.close();
        }
    }

Here I use printstream to write,you can also use write function with format for example a.write("albert");

0 comments:

Post a Comment

ABOUT ME

IP
Albert Julius. Powered by Blogger.
Copyright © Albert'Blog