Advertisement
popatop15

Untitled

Aug 7th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. package space.indica.FileAddition;
  2.  
  3. import java.io.FileNotFoundException;
  4. import java.io.FileReader;
  5. import java.io.FileWriter;
  6. import java.io.File;
  7. import java.io.BufferedReader;
  8. import java.io.BufferedWriter;
  9. import java.io.IOException;
  10.  
  11. public class FileAddition {
  12.  
  13. public static void main(String[] args) {
  14.  
  15. FileReader input1 = null,input2 = null;
  16. BufferedReader reader1 = null, reader2 = null;
  17.  
  18. try {
  19. input1 = new FileReader("file1.txt");
  20. input2 = new FileReader("file2.txt");
  21. } catch (FileNotFoundException e) {
  22. System.out.println("One or more files were not found!");
  23. }
  24.  
  25. if (input1 != null || input2 != null) {
  26. System.out.println("Files have been innitialized successfully!");
  27.  
  28. reader1 = new BufferedReader(input1);
  29. reader2 = new BufferedReader(input2);
  30. }
  31.  
  32. }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement