Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. public void more(String path) throws Exception {
  2.  
  3. File file = new File(path);
  4. File fileSameDir = new File(Dd+path);
  5. Scanner enter = new Scanner(System.in);
  6.  
  7. if (fileSameDir.exists() ){
  8.  
  9. Scanner sc = new Scanner(fileSameDir);
  10.  
  11. while (sc.hasNextLine()) {
  12. System.out.print(sc.nextLine());
  13. String x = enter.nextLine();
  14. if (x=="")continue;
  15. }
  16. } else if (file.exists()){
  17.  
  18. Scanner sc = new Scanner(file);
  19.  
  20. while (sc.hasNextLine()){
  21. System.out.print(sc.nextLine());
  22. String x = enter.nextLine();
  23. if (x=="")continue;}
  24.  
  25. }else {
  26. System.out.println(obj.printError("File not found"));
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement