官术网_书友最值得收藏!

Literals

In the previous discussion, we've seen a String literal and an Integer too. Here, we'll discuss all available literals, and how to define them in Scala. If you're coming from a Java background, then quite a few will be the same for you: Integer, Floating point, Boolean, Character, and String are similar. Along with those, the Tuple and Function literals can be treated as something new to learn. All the literals are listed as follows:

  • Integer literals
  • Floating point literals
  • Boolean literals
  • Character literals
  • String literals
  • Symbol literals
  • Tuple literals
  • Function literals

We'll discuss them one by one. Let's start with Integer literals.

主站蜘蛛池模板: 包头市| 高邮市| 藁城市| 昌乐县| 内黄县| 密山市| 大名县| 韩城市| 大悟县| 武邑县| 策勒县| 曲靖市| 都昌县| 辉县市| 两当县| 萨迦县| 孟津县| 澜沧| 青铜峡市| 博湖县| 饶平县| 白沙| 绥芬河市| 溆浦县| 星座| 临武县| 芦山县| 桑日县| 兰溪市| 遂溪县| 湟源县| 林口县| 衢州市| 绍兴市| 虹口区| 林州市| 崇仁县| 苍梧县| 新丰县| 织金县| 油尖旺区|