Scala基础--控制结构 - webdancer's Blog

Scala基础--控制结构

webdancer posted @ 2014年1月05日 03:37 in 未分类 , 1456 阅读

1.if,while,do while与Java相同;

2.for:

  • 遍历集合对象中的每一个元素;
for(i <- 1 to 4)
	println(i)
  • 遍历集合对象中的部分元素:
for(i <- 1 to 4 if i > 2)
	println(i)

 

Rajasthan Board 1st 说:
2022年8月20日 18:52

Rajasthan Board Model Paper 2023 Class 1 Pdf Download with Answers for Rajasthani Medium, English Medium, Hindi Medium, Urdu Medium & Students for Small Answers, Long Answer, Very Long Answer Questions, and Essay Type Questions to Term1 & Term2 Exams at official website. Rajasthan Board 1st Class Model Paper New Exam Scheme or Question Pattern for Sammittive Assignment Exams (SA1 & SA2): Very Long Answer (VLA), Long Answer (LA), Small Answer (SA), Very Small Answer (VSA), Single Answer, Multiple Choice and etc.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter
Host by is-Programmer.com | Power by Chito 1.3.3 beta | © 2007 LinuxGem | Design by Matthew "Agent Spork" McGee