Java-source: Ecrire des booléen dans un fichier

Java-source: Ecrire des booléen dans un fichier
{filelink=304}

/***** Code de MesExemples.com *******/
import java.io.DataOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
 
class WriteBooleanToFile {
 
public static void main(String[] args) {
 
String strFilePath = "C://test.txt";
 
try
{
 
FileOutputStream fout = new FileOutputStream(strFilePath);
DataOutputStream dos = new DataOutputStream(fout);
 
boolean b = false;
 
dos.writeBoolean(b);
 
dos.close();
 
}
catch (IOException e)
{
System.out.println("IOException : " + e);
}
 
}
}

Be the first to leave a comment. Don’t be shy.

Join the Discussion

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>