tình hình là cái này là bài tập do thầy đưa ra mà em hơi dốt nên đi copy ạ. nên ko biết cho hàm kia zô main thế nào, các bác giúp em với . em cám ơn ạ
package bai3;
import java.io.DataOutputStream;
import java.io.File;
import static java.io.FileDescriptor.out;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
/**
*
-
@author Tuan Phung
*/
public class Bai3 {/**
-
@param args the command line arguments
*/
public static void main(String[] args) throws FileNotFoundException {
DataOutputStream x;
///////
}
DataOutputStream dos;
public boolean writeTOFile(String fileName, String dataLine,
boolean isAppendMode, boolean isNewLine){
if(isNewLine){
dataLine = “\n” + dataLine;
}
try{
File outFile = new File(fileName);
if (isAppendMode){
dos = new DataOutputStream(new FileOutputStream(fileName, true));}//end iff else{ dos = new DataOutputStream(new FileOutputStream(outFile)); }// end else dos.writeBytes(dataLine); dos.close(); } catch (FileNotFoundException ex){ return (false); }catch (IOException ex){ return (false); } return (true);}
-
@param args the command line arguments
}

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?