快学scala第一章习题谜底(国外英文资料).docVIP

  • 6
  • 0
  • 约3.2万字
  • 约 8页
  • 2017-06-08 发布于河南
  • 举报

快学scala第一章习题谜底(国外英文资料).doc

快学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

文档评论(0)

1亿VIP精品文档

相关文档