Scala for the Impatient课后练习(第1章 The Basics)
来源:互联网 发布:野猪骑士升级数据 编辑:程序博客网 时间:2024/06/11 22:45
1、在Scala REPL中键入3,然后按Tab键。有哪些方法可以被应用?
2、在Scala REPL中,计算3的平方根,然后再对该值求平方。现在,这个结果与3相差多少?
3、res变量是val还是var?(答案:val)
4、Scala允许你用数字去乘字符串---去REPL中试一下"crazy * 3"。这个操作做什么?在Scaladoc中如何找到这个操作?
5、10 max 2的含义是什么?max方法定义在哪个类中?
6、用BigInt计算2的1024次方
7、为了在使用probablePrime(100, Random)获取随机素数时不在probablePrime和Random之前使用任何限定符,你需要引入什么?
答案要点:probablePrime是BigInt伴生对象中的方法(类似于Java当中的静态方法)
8、创建随机文件的方式之一是生成一个随机的BigInt,然后将它转换成三十六进制,输出类似"qsnvbevtomcj38o06kul"这样的字符串。查阅Scaladoc,找到在Scala中实现该逻辑的方法。
9、在Scala中如何获取字符串的首字母和尾字母?
10、take、drop、takeRight和dropRight这些字符串函数是做什么用的?和substring相比,他们的优点和缺点都是哪些?
优点:没怎么感觉到
缺点:不能中间截取字符串
0 0
- Scala for the Impatient课后练习(第1章 The Basics)
- 《快学Scala》, <Scala For the Impatient>习题第二章
- 《快学Scala》, <Scala For the Impatient>习题第三章
- scala 学习笔记(scala for the impatient)
- 《快学Scala》, <Scala For the Impatient>习题第一章
- Open Source Big Data for the Impatient, Part 1
- Scala.for.the.Impatient.2nd.Edition.2016.12.pdf 英文原版 免费下载
- Scala for the Impatient, 2nd Edition.pdf 英文原版 免费下载
- swift 1: the basics
- Groovy Tutorial for Java Developers – Part 1: The Basics
- swift3.1(1)The Basics
- Boost.Interprocess使用手册翻译之二:快速指南 (Quick Guide for the Impatient)
- Boost.Interprocess使用手册翻译之二:快速指南 (Quick Guide for the Impatient)
- Boost.Interprocess使用手册翻译之二:快速指南 (Quick Guide for the Impatient)
- Boost.Interprocess使用手册翻译之二:快速指南 (Quick Guide for the Impatient)
- The Basics of the MMAPI for Java Developers->Media Capture
- Using Perl6 第二章:The Basics
- I. The Basics---Chapter 1----Dissecting Display
- log4net的简单应用
- SMB协议
- SIFT算法详解
- Leetcode Problem.88 —Merge Sorted Array
- Java软件开发中的几种认识误区
- Scala for the Impatient课后练习(第1章 The Basics)
- 数据分析(工具篇)笔记---回归分析
- 边读边计算的如果用计数器则可以指定读取第几行内容第一例(答复:咨询VB读文本文件,文本文件有N行,3列。想得到1、2列相同时。3列的值求和)http://bbs.csdn.net/topics/390
- 加盟学天
- 继承ActionInterval来实现圆周运动
- UITableView 横向滚动(二)
- 面试形象标准礼仪
- 设计模式remember——模板方法模式
- Leetcode Problem.118—Pascal's Triangle