Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- class Hello
- {
- public static void main(String[] args) throws Exception
- {
- BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
- String s;
- s = br.readLine();
- FileWriter fw = new FileWriter("D:\\pradeep.txt");
- for(int i=0;i<s.length();i++)
- {
- fw.write(s.charAt(i));
- }
- fw.close();
- try
- {
- FileReader fr = new FileReader("D:\\pradeep.txt");
- int ascii;
- while((ascii=fr.read())!=-1)
- {
- System.out.print((char)ascii);
- }
- fr.close();
- }
- catch(Exception e)
- {
- System.out.println(e);
- }
- finally
- {
- System.out.print("Operation Completed ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement