scala 写文件功能:
scala> import java.io.PrintWriter
import java.io.PrintWriter
scala> val outputFile = new PrintWriter("text.txt")
outputFile: java.io.PrintWriter = java.io.PrintWriter@213c812a
scala> outputFile.println("hello panzidong")
scala> outputFile.print("spark is good")
scala> outputFile.close()
scala>
result: