Scala if Statements
来源:互联网 发布:sql server log工具 编辑:程序博客网 时间:2024/05/23 01:16
What’s different in Scala is that if
statements and almost all other statements in Scala are actually expressions that return values. If it’s true
, then the corresponding block is evaluated. Otherwise, the next branches are tested and so forth.
code example :
val configFile = new java.io.File("somefile.txt")val configFilePath = if (configFile.exists()) { configFile.getAbsolutePath()} else { configFile.createNewFile() configFile.getAbsolutePath()}
Ref
《Programming Scala》
0 0
- Scala if Statements
- 4.1. if Statements(if 语句)
- 12.3.3.5 If statements
- 4.4.1.1 if-statements
- C Programming Quiz: If statements
- PHP if-else-endif Statements
- Lesson 2: If statements in C
- Using If/Truth Statements with pandas¶
- Scala if -- else 语句
- Scala中if使用
- If-then-Else Statements--RTF文档
- Do-While and if-else statements in C/C++ macros
- 4.2.1 - Flow Control Using If/Else Statements
- scala学习(5)——if判断
- Scala学习二:If 控制语句
- scala(7)-----IF...ELSE 语句
- Scala的基础if和for
- Why are there sometimes meaningless do/while and if/else statements in C/C++ macros?
- vbox错误:被召者 RC: REGDB_E_CLASSNOTREG (0x80040154)
- Tabbar点击时候超炫小动画
- 欢迎使用CSDN-markdown编辑器
- 黑客与画家
- android提供外部资源的规则和注意事项
- Scala if Statements
- iOS 获取通讯录
- ras工具类
- 【转载】《计算机教育》专题报道:从一个教育实例,看信息技术对教育的影响
- 关于建表的补充
- 2017华为面试算法题小结
- 深度学习框架Caffe配置:Ubuntu 16.04+CUDA8.0+cuDNN5.1+OpenCV3.1+Anaconda+Octave4.0.3
- Android 工程签名打包时报错
- Mac Python实用工具开发记录