import java.io.*; 
class writeandread
{ 
     public static void main (String args[]) throws IOException 
     { 
                String s1="first"; 
                String s2="second"; 
                String s3="third"; 
                PrintWriter cfout=new PrintWriter(new BufferedWriter(new FileWriter("abc.txt"))); 
                cfout.println("Hello"); 
                cfout.println("What is your name?"); 
                cfout.println("nice to meeting you"); 
                cfout.close(); 
                BufferedReader cfin=new BufferedReader(new FileReader("abc.txt")); 
                s1=cfin.readLine(); 
                s2=cfin.readLine(); 
                s3=cfin.readLine(); 
                cfin.close(); 
                System.out.println("s1 = "+s1); 
                System.out.println("s2 = "+s2); 
                System.out.println("s3 = "+s3); 
     } 
} 
