Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
String temp = null;と宣言し、初期化しました。
プログラムを通して私はtempの値をによって変更しています
temp = temp + folder [i] + newline;
次に、このStringtempをテキストファイルに書き込みます。
問題は、ファイルに書き込むたびに、「NULL」という単語も出力されることです。
回避策を提案してください。
tempをnullではなく""に初期化します
temp = temp + folders[i] + newline;
は
temp = null + folders[i] + newline;
したがって、ファイルにnullを出力します。代わりに「」を使用してください。