Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.crypto.SecretKey;
- import java.io.*;
- import java.lang.*;
- import java.util.*;
- public class CreateFile {
- // Variables
- private Formatter x;
- // Methods
- public void openFile(){
- try{
- x = new Formatter("Chinese.txt");
- }
- catch (Exception e){
- System.out.println("You have got an error");
- }
- }
- public void addRecords(){
- x.format("%s %s %s", "Name", "Surname", "22");
- }
- public void closeFile(){
- x.close();
- }
- // Main Function
- public static void main(String[] args){
- CreateFile f = new CreateFile();
- f.openFile();
- f.addRecords();
- f.closeFile();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement