写文件
代码语言:javascript复制package com.bi
import java.io.{File, PrintWriter}
/**
* Created by xxx on 2017/6/30.
*/
object FileHandler {
def fileWriter(fileName: String, content: String): Unit = {
val writer = new PrintWriter(new File(fileName))
writer.write(content)
writer.close()
}
def main(args: Array[String]): Unit = {
fileWriter("ssss", "sdfadffffffffffffff")
fileWriter("ssss", "2222222222222222222222222222")
}
}