You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FileWriter myWriter = new FileWriter("codeTestOutput.txt");
return myWriter;
}
catch (IOException e) {
System.out.println("An error occurred.");
e.printStackTrace();
}
return null;
}
public static void writeFile(FileWriter writer, String text){
try{
writer.write(text + "\n");
return;
} catch (IOException e) {
System.out.println("An error occurred.");
e.printStackTrace();
}
return;
}
public static void closeFile(FileWriter writer){
try{
writer.close();
return;
} catch (IOException e) {
System.out.println("An error occurred.");
e.printStackTrace();
}
return;
}
public static boolean selectItem ( int [ ] nums , int item ) { for ( int i = 0 ; i < nums. length ; i ++ ) { if ( nums [ i ] == item ) { return true ; } } return false ; }