那麼,我正在嘗試編寫一行信息來登錄文本文件(.txt),但這是代碼無法寫入的部分。除此之外,其他一切都有效,但不會給出任何錯誤。Write-to-file代碼不寫
public void writeConfig(File config, Boolean append, String errored){
try {
Writer output;
if (config != null){
output = new BufferedWriter(new FileWriter(config));
} else {
output = new BufferedWriter(new FileWriter(er));
}
if (append == true){
output.append(errored);
} else {
output.write(errored);
}
} catch (Exception e){
try {
loadErrorLog(error, true, "Failed to write to Boom's Log.\n");
} catch (Exception e1){
log.info("Major Malfunction #686 : Tell Maker immediatly.");
}
}
}
爲什麼'append'一個'Boolean'而不是一個'boolean'? –