Examlex

Solved

The File Data

question 41

Short Answer

The file data.txt contains ABC before the code below is executed: What does data.txt contain after the code below is executed, assuming that the file is found?
try
{
FileOutputStream fos = new FileOutputStream( "data.txt", true );
PrintWriter pw = new PrintWriter( fos );
pw.println( "\nDEF" );
pw.close( );
}
catch( FileNotFoundException fnfe )
{
System.out.println( "GHI" );
}


Definitions:

Related Questions