- 6
- 0
- 约3.2万字
- 约 8页
- 2017-06-08 发布于河南
- 举报
快学scala第一章习题谜底(国外英文资料)
快学scala第一章习题答案(国外英文资料)
1 Introduction?
Recently, more interested in Scala, bought the fast learning Scala, I feel good. Better than Programming Scala:Tackle Multi-Core Complexity on Java Virtual Machine the. Its a good primer. And each chapter has a level of difficulty, and each chapter has exercises to consolidate the Scala syntax. ?
The purpose of this paper is to answer these exercises
2 Foundation?
2.1 type 3 in Scala REPL, and then press the Tab key. What methods can be applied?
This.... Direct operation once again has the result. This question does not know is the translation question, or the original question, in Scala REPL needs to press 3., then press Tab will prompt. There is no hint to press 3 plus Tab directly. Here is the result?
Scala code?
1.! =????????????? ##?????????????%?????????????? and???????????????????????????? +??
2. -?????????????? /?????????????? ?????????????? the????????????? =????????????? = =??
3.?????????????? =??????????????????????????.???????????? ^?????????????? asInstanceOf??
4. equals??????????????? IsInstanceOf???? toByte??????????????????????? GetClass???????? hashCode?????? toChar?
5. toDouble??????????????????????????? ToLong????? ToShort??????????????? ToFloat????? ToInt????????????? ToString?????????????????
6. unary_+???????? unary_-???????? unary_~???????? |??
The methods listed are incomplete. Do you need to check all the methods, or do you need to go to the Int, Double, RichInt, RichDouble, and other classes in Scaladoc?. ?
2.2 in Scala REPL, calculate the square root of 3, and then square the value. Now, what is the difference between this result and 3? (hint: res variables are your friends?)
Calculate in turn
Scala code?
1. scala? Scala.math.sqrt (3)?
2., warning:, there, were, 1, deprecation, warnings, re-run, with, -deprecation, details, for???
3. res5:, Double = = 1.7320508075688772?
4.??
5. scala? Res5*res5??
6. res6:, Double = = 2.9999999999999996?
7.??
8. scala? 3? - res6??
9. res7: = Double = 4.4408920985006
您可能关注的文档
最近下载
- 海绵城市监理实施细则范本·仅供参考.doc VIP
- 七年级数学下册-相交线与平行线测试题(同名10636).doc VIP
- 《跨学科主题学习设计与实施》全套教学课件.pptx
- 建设工程项目管理全套课件.pptx
- 数控多轴加工编程与仿真全套教学课件.pptx
- 2018助理班主任工作总结3篇-2018助理班主任工作总结3篇-2018助理班主任工作总结3篇-.doc VIP
- 《水工程施工》课程大纲.pdf VIP
- 市政管线项目划分.doc VIP
- 2026年春季开学第一课 课件:策马新学期,筑梦向远方-2025-2026学年下学期优质主题班会(全国通用).pptx
- 初高中英语必背4000个词汇表.pdf
原创力文档

文档评论(0)