Thank you! Chandra.Actually i did something more to that code.
import java.io.*;
class Testdir
{
public static void main(
String args[])
{
try
{
File mydir = new File("mydir1");
mydir.mkdir();
File myfile = new File(mydir,"myfile1.txt");
PrintWriter pw = new PrintWriter(myfile);
pw.println("Scjp 1.5");
pw.println("is a tough exam");
pw.flush();
pw.close();
File file2 = new File(mydir,"myfile2.txt");
file2.createNewFile();
FileReader fr = new FileReader(myfile);
BufferedReader br= new BufferedReader(fr);
String str;
while((str=br.readLine()) !=null)
System.out.println(str);
fr.close();
}
catch(IOException ex)
{
System.out.println("Exception:" +ex);
}
}
}
After compiling and running the code above i got result as: Not equal.
Where did that "not equal" come from and i couldn't see any actual directory. I think i did something wrong with that code.Pls help.