当前位置:网站首页>scala basics
scala basics
2022-08-10 15:21:00 【S_ng】
1、基本语法
o 区分大小写
o 类名:首字母要大写,如 class HelloWorld{},class
Person{},class Student{},也称大驼峰
o 方法名称:首字母小写,从第 2 个单词开启的首字段大写,如
def toString(),def getName(),即为小驼峰
o 程序文件名:保持与类名或对象名一致,区分大小写,以
".scala"来结尾.
o 主程序入口:def main(args: Array[String]) ,scala To run independently
必须从 main 方法开始处理,每个 scala 强制程序入口.
2、关键字
o The following are reserved keywords,Do not use keywords as variable names.
abstract case catch class
def do else extends
false final finally for
forSome if implicit import
lazy match new null
object override package private
protected return sealed super
this throw trait trytrue type val var while with yield - : = => <- <: <% >: # @
3、数据类型
与 Java 相似部分(皆为对象类型,scala 无原生数据类型)Byte,Short,Int,Long,Float,Double,Char,String,Boolean
4、运算符
无自增自减,其余和java相同.
5、循环
String 类.
完全与 java.lang.String 对等
边栏推荐
- Appium进行APP自动化测试
- Understanding_Data_Types_in_Go
- Analysys and the Alliance of Small and Medium Banks jointly released the Hainan Digital Economy Index, so stay tuned!
- 高薪程序员&面试题精讲系列135之你对分布式是怎么理解的?CAP理论你知道吗?
- C#实现访问OPC UA服务器
- Summary of tensorflow installation stepping on the pit
- 紫金示例
- 字节终面:CPU 是如何读写内存的?
- JS 从零手写实现一个bind方法
- QOS功能介绍
猜你喜欢
关于已拦截跨源请求CORS 头缺少 ‘Access-Control-Allow-Origin‘问题解决
Flask框架——基于Celery的后台任务
Understanding_Data_Types_in_Go
SWIG tutorial "two"
12海里、24海里、200海里的意义及名称
QOS function introduction
Unfinished mathematics test paper ----- test paper generator (Qt includes source code)
紫金示例
2022年网络安全培训火了,缺口达95%,揭开网络安全岗位神秘面纱
符合信创要求的堡垒机有哪些?支持哪些系统?
随机推荐
Introduction to the Internet (2)
Steam教育在新时代中综合学习论
Meaning and names of 12 nautical miles, 24 nautical miles and 200 nautical miles
线上线下课程教学培训小程序开发制作功能介绍
scala集合
机器学习总结(一)
符合信创要求的堡垒机有哪些?支持哪些系统?
PAT甲级 1014 排队等候(队列大模拟+格式化时间)
MQTT服务器搭建
JS entry to proficient full version
SWIG教程《四》-go语言的封装
领域驱动模型设计与微服务架构落地-从项目去剖析领域驱动
网络安全(加密技术、数字签名、证书)
Pytest framework optimization
640. Solving Equations: Simple Simulation Problems
易观分析联合中小银行联盟发布海南数字经济指数,敬请期待!
波士顿房价预测
XML基本学习
SWIG Tutorial "One"
C#实现访问OPC UA服务器