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:

learning scala write to file的更多相关文章

  1. learning scala read from file

    scala读文件:   example: scala> import scala.io.Sourceimport scala.io.Source scala> var inputFile ...

  2. learning scala 数组和容器

    数组:可变的,可索引的,元素具有相同类型的数据集合 一维数组 scala> val intValueArr = new Array[Int](3)intValueArr: Array[Int] ...

  3. learning scala control statement

    1 .if satement 与其它语言不同的是,scala if statement 返回的是一个值 scala> val a = if ( 6 > 0 ) 1 else -1a: In ...

  4. learning scala output to console

    控制台输出语句: print println example: scala> print("i=");print(i)i=345scala> println(" ...

  5. learning scala read from console

    控制台输入语句: readInt, readDouble, readByte, readShort, readLong, readChar, readBoolean, readLine example ...

  6. learning scala 变量

    scala 变量: val : 声明时,必须被初始化,不能再重新赋值. scala> test = "only1"<console>:11: error: not ...

  7. learning scala 操作符

    scala 操作符: 算术运算符:  +  - *  / % 关系统运算符: > , < ,= ,!= ,>=,<=, 逻辑运算符: && . || , ! 位 ...

  8. learning scala akka ask_pattern

    package com.example import akka.actor._ import akka.util.Timeout object Tutorial_03_Ask_Pattern exte ...

  9. learning scala akka actorySystem create and close

    package com.example import akka.actor.ActorSystem import scala.util.{Failure, Success} import scala. ...

随机推荐

  1. Python - requests https请求的坑

    #-*-coding:utf-8-*- # Time:2017/9/25 20:41 # Author:YangYangJun import requests import ssl from requ ...

  2. 零点红旗echarts

    当月销量 当月同比 当月市场份额 区域占比 累计销量 累计同比 累计市场份额 区域占比 lists = { district:[ {name: '东北', value: [20100,'+13%',' ...

  3. Asp.net core 学习笔记 ( HttpClient )

    2018-09-18 core 2.1 之后有新的方案咯 http://www.talkingdotnet.com/3-ways-to-use-httpclientfactory-in-asp-net ...

  4. (转)winform之ListView

    一.ListView类 1.常用的基本属性: (1)FullRowSelect:设置是否行选择模式.(默认为false) 提示:只有在Details视图该属性才有意义. (2)GridLines:设置 ...

  5. (转)C# 单例模式

    文章1:  一.多线程不安全方式实现 public sealed class SingleInstance    {        private static SingleInstance inst ...

  6. cookie知识点

    1.springmvc框架中,cookie例子 jsp: <%-- Created by IntelliJ IDEA. User: 44262 Date: 2019/2/28 Time: 18: ...

  7. one-class logistic regression (OCLR)

    ONE-CLASS DETECTION OF CELL STATES IN TUMOR SUBTYPES Machine Learning Identifies Stemness Features A ...

  8. 11月24日 layouts and rendering in rails(部分没有看)

    http://guides.rubyonrails.org/layouts_and_rendering.html  中文 This guide covers the basic layout feat ...

  9. Django的form组件

    forms组件 forms组件,是一个类.在视图函数中创建一个类,类需要继承forms.Form from django import  forms 1.校验数据 步骤和语法: 1. 创建一个form ...

  10. 3.numpy_array数组

    官方文档:www.numpy.org.cn Numpy 数组及其索引 先导入numpy: from numpy import * 产生数组 从列表产生数组: lst = [0, 1, 2, 3] a ...