Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.*;
- class Readfile
- {
- private String s="";
- void read () throws IOException
- {
- FileInputStream fin = new FileInputStream("input.txt");
- Scanner input = new Scanner(fin,"UTF-8");
- s = input.nextLine();
- input.close();
- }
- void out ()
- {
- System.out.println("this is : " +s);
- }
- String ref()
- {
- return s;
- }
- }
- class java_in_out_file
- {
- public static void main(String args[]) throws IOException
- {
- Readfile r = new Readfile();
- String s = "";
- r.read();
- s = r.ref();
- System.out.println(s);
- //r.out();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement