import java.io.FileOutputStream;
public class Main {
public static void main(String[] args) {
String data = "This is a line of text inside the file.";
try {
FileOutputStream output = new FileOutputStream("output.txt");
byte[] array = data.getBytes();
// Writes byte to the file
output.write(array);
output.close();
}
catch(Exception e) {
e.getStackTrace();
}
}
}
// Including the boolean parameter
FileOutputStream output = new FileOutputStream(String path, boolean value);
// Not including the boolean parameter
FileOutputStream output = new FileOutputStream(String path);