The Wayback Machine - https://web.archive.org/web/20170114114445/http://pastebin.com:80/7zWw1dSu
SHARE
TWEET

Untitled

a guest Jan 13th, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Main {
  2.  
  3.         private static final String FILENAME = "D:\\data.txt";
  4.  
  5.         public static void main(String[] args) {
  6.             String text = new String();
  7.             readFile(FILENAME);
  8.  
  9.         }
  10.         public static void readFile (String FILENAME) {
  11.             String sCurrentLine;
  12.             BufferedReader br = null;
  13.             FileReader fr = null;
  14.             try {
  15.  
  16.                 fr = new FileReader(FILENAME);
  17.                 br = new BufferedReader(fr);
  18.  
  19.  
  20.  
  21.                 while ((sCurrentLine = br.readLine()) != null) {
  22.                     changeFile(sCurrentLine);
  23.                 }
  24.  
  25.             } catch (IOException e) {
  26.                 e.printStackTrace();
  27.  
  28.             } finally {
  29.  
  30.                 try {
  31.                     if (br != null)
  32.                         br.close();
  33.  
  34.                     if (fr != null)
  35.                         fr.close();
  36.  
  37.                 } catch (IOException ex) {
  38.                     ex.printStackTrace();
  39.  
  40.                 }
  41.             }
  42.         }
  43.         public static  void changeFile (String FILENAME) {
  44.             String text = "";
  45.  
  46.             if (text != null) {
  47.                   text = text + FILENAME;
  48.             }
  49.             System.out.println(text);
  50.         }
  51.  
  52. }
RAW Paste Data
Top
Morty Proxy This is a proxified and sanitized view of the page, visit original site.