Advertisement
nguyenvanquan7826

input_file 1

May 15th, 2013
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1.  
  2. import java.io.*;
  3. import java.util.*;
  4.  
  5. class Readfile
  6. {
  7.     private String s="";
  8.     void read () throws IOException
  9.     {
  10.         FileInputStream fin = new FileInputStream("input.txt");
  11.         Scanner input = new Scanner(fin,"UTF-8");
  12.         s = input.nextLine();
  13.         input.close();
  14.     }
  15.    
  16.     void out ()
  17.     {
  18.         System.out.println("this is : " +s);
  19.     }
  20.    
  21.     String ref()
  22.     {
  23.         return s;
  24.     }
  25. }
  26.  
  27. class java_in_out_file
  28. {
  29.     public static void main(String args[]) throws IOException
  30.     {
  31.         Readfile r = new Readfile();
  32.         String s = "";
  33.         r.read();
  34.         s = r.ref();
  35.         System.out.println(s);
  36.         //r.out();
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement