//Sample06_02.java import java.io.File; import java.io.FileOutputStream; import java.io.OutputStreamWriter; import java.io.BufferedWriter; import java.io.IOException; import java.io.UnsupportedEncodingException; class Sample06_02{ public static void main(String[] args){ String path = "hello.txt"; File file = new File(path); String[] strs = { "赤いきつね", "緑のたぬき", "碧いうさぎ", "白のパンダ", "ピンクのパンサー" }; try { BufferedWriter br = new BufferedWriter( new OutputStreamWriter( new FileOutputStream(file, true), "UTF-8" // ^ココ ) ); for(String str :strs){ br.write(str); br.newLine(); } br.close(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (IOException e){ e.printStackTrace(); } } }