Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.*;
- class FileJoin {
- public static void main(String [] args) {
- try {
- PrintWriter p = new PrintWriter(args[2]);
- Scanner one = new Scanner(new File(args[0]));
- Scanner two = new Scanner(new File(args[1]));
- while(one.hasNext()) {
- String input = one.next();
- p.print(input + " ");
- }
- one.close();
- while(two.hasNext()) {
- String input = two.next();
- p.print(input + " ");
- }
- two.close();
- p.close();
- }
- catch(Exception e) {
- e.printStackTrace();
- }
- }
- }
Add Comment
Please, Sign In to add comment