zoukankan      html  css  js  c++  java
  • scala基本数据类型学习

      Scala does not support octal literals; integer literals that start with a 0, such as 031, do not compile.

      If an integer literal ends in an L or l, it is a Long; otherwise it is an Int.

      If a floating-point literal ends in an F or f, it is a Float; otherwise it is a Double. Optionally, a Double floating-point literal can end in D or d.

      Character literals are composed of any Unicode character between single quotes.

      In addition to providing an explicit character between the single quotes, you can identify a character using its Unicode code point. To do so, write u followed by

    four hex digits with the code point, like this:

      scala> val d = 'u0041'

      d: Char = A

      scala> val f = 'u0044'

      f: Char = D  

      This identifier is treated as identical to BAD, the result of expanding the two Unicode characters in the code above. In general, it is a bad idea to name

    identifiers like this because it is hard to read. Rather, this syntax is intended to allow Scala source files that include non-ASCII Unicode characters to

    be represented in ASCII.

      A string literal is composed of characters surrounded by double quotes.

      You start and end a raw string with three double quotation marks in a row ("""). The interior of a raw string may contain any characters whatsoever, including

    newlines, quotation marks, and special characters, except of course three quotes in a row.

  • 相关阅读:
    php学习推荐
    python 安装numpy报错
    PHP最基础
    php自定义错误函数
    phpMyAdmin安装
    php链接mysql提示:Call to undefined function mysql_connect()
    POJ 1005 解题报告
    亚马逊在线笔试(2014/10/9)
    LeetCode 题目 word break 思路剖析与改进
    Dijkstra单源最短路算法的C++实现
  • 原文地址:https://www.cnblogs.com/25th-engineer/p/11255876.html
Copyright © 2011-2022 走看看