public void writeToFile(String str1,String str2)
{
if(!file.exists())
{
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
PrintWriter pw = null;
try {
pw = new PrintWriter(new FileWriter(file,true));
pw.println("#");
pw.println(str1);
pw.println(str2);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
pw.close();
}
}
{
if(!file.exists())
{
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
PrintWriter pw = null;
try {
pw = new PrintWriter(new FileWriter(file,true));
pw.println("#");
pw.println(str1);
pw.println(str2);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
pw.close();
}
}