2017-07-24 126 views

回答

1

正如Scaladoc狀態棄用注意,使用Console.withOut,這需要一個OutputStream

import java.io.{File, FileOutputStream} 

val fos = new FileOutputStream(new File("/path/to/file.txt")) 
Console.withOut(fos) { println("print this to the file") } 
相關問題