1.在只有Lambda表达式的状况下,参数的类型必须写出来。html
2.Lambda表达式自己是中性的,一样的Lambda表达式可用来表示不一样目标类型的对象操做。java
3.Lambda表达式只关心方法命名上的参数与返回定义,但忽略方法名称。git
4.若是变量不会在匿名类中有从新指定的动做,就能够不用加上final关键词。 5.只要静态方法的方法命名中参数与返回值定义相同,也可使用静态方法来定义函数接口操做。express
6.JDK8定义的通用函数接口,基本上放置于java.util.function套件之中,就行为来讲,基本上能够分为consumer,function,predicate,supplier四个类型。swift
7.Epoch为某个特定时代的开始,时间轴上某一瞬间。markdown
8.取得系统时间的方法之一是使用System,currentTimeMillis()方法,返回的是long类型整数。app
9.Date实例基本上建议只用来当作时间轴上的某一瞬间。函数
10.ofDays(),ofMonths(),ofWeeks()实际上是Period的静态方法,他们会返回period实例。oop
11.新时间日期处理API的主要套件命名为java.time。学习
12.plus方法接受java.time.temporal.TemporalAmount实例,而TemporalAmount的操做类也就是Period与Duration。实际上plus()方法也能够接受Duration实例来计算。
13.使用Instant的静态方法now()能够取得表明java epoch毫秒数的Instant实例。
import java.util.*; import java.text.*; public class HowOld { public static void main(String[] args) throws Exception { System.out.print("輸入出生年月日(yyyy-mm-dd):"); DateFormat dateFormat = new SimpleDateFormat("yyyy-mm-dd"); Date birthDate = dateFormat.parse(new Scanner(System.in).nextLine()); Date currentDate = new Date(); long life = currentDate.getTime() - birthDate.getTime(); System.out.println("你今年的歲數為:" + (life / (365 * 24 * 60 * 60 * 1000L))); } }
out.println(calendar.get(Calendar.YEAR)); out.println(calendar.get(Calendar.MONTH)); out.println(calendar.get(Calendar.DATE));
调用线程的interrupt()方法 ,会抛出()异常对象?
A .
IOException
B .
IllegalStateException
C .
RuntimeException
D .
InterruptedException
E .
SecurityException
正确答案: D E
int x = Integer.parselnt ("42a") ;
//insert code here
System.out.print ("oops");
B .
} catch (IllegalStateException c) {
C .
} catch (NumbelFormatException n) {
D .
} catch (ClassCastException c) {
正确答案: A C
A .
new ParallelStream(s)
B .
c.parallel()
C .
s.parallelStream()
D .
c.parallelStream()
E .
new ParallelStream(c)
F .
s.parallel()
正确答案: D F
Which of the following statements about the Callable call() and Runnable run() methods are correct? (Choose all that apply.)
A .
Both can throw unchecked exceptions.
B .
Callable takes a generic method argument.
C .
Callable can throw a checked exception.
D .
Both can be implemented with lambda expressions.
E .
Runnable returns a generic type.
F .
Callable returns a generic type.
G .
Both methods return void
正确答案: A C D F
What are some reasons to use a character stream, such as Reader/Writer, over a byte stream, such as InputStream/OutputStream? (Choose all that apply.)
A .
More convenient code syntax when working with String data
B .
Improved performance
C .
Automatic character encoding
D .
Built-in serialization and deserialization
E .
Character streams are high-level streams
F .
Multi-threading support
正确答案: A C
A .
It prints the first line of the file to the console.
B .
It prints the entire contents of the file.
C .
The code does not compile because the reader is not closed.
D .
The code does compile, but the reader is not closed.
E .
The code does not compile for another reason.
正确答案: A 你的答案
A .
The code runs without error but prints nothing.
B .
The code prints what was entered by the user.
C .
An ArrayIndexOutOfBoundsException might be thrown.
D .
A NullPointerException might be thrown.
E .
An IOException might be thrown.
F .
The code does not compile.
正确答案: B D E
A .
A new Console object is created every time System.console() is called.
B .
Console can only be used for reading input and not writing output.
C .
Console is obtained using the singleton pattern.
D .
When getting a Console object, it might be null.
E .
When getting a Console object, it will never be null.
正确答案: C D
A .
new File("c:\book\java");
B .
new File("c:\book\java");
C .
new File("c:/book/java");
D .
new File("c://book//java");
E .
None of the above
正确答案: B C
A .
System.err
B .
System.error
C .
System.in
D .
System.input
E .
System.out
F .
System.output
正确答案: A C E
正确使用Markdown语法(加1分):
模板中的要素齐全(加1分)
教材学习中的问题和解决过程, 一个问题加1分
代码调试中的问题和解决过程, 一个问题加1分
本周有效代码超过300分行的(加2分)
其余加分:
扣分:
博客中值得学习的或问题:
代码中值得学习的或问题:
基于评分标准,我给本博客打分:XX分。得分状况以下:xxx
这周学习了第十二章和第十三章的内容。主要学习的是第十三章,讲的主要是时间与日期,我了解了时间与日期的基本知识,再进一步用Java语言实现时间与日期的输出。用书上的代码练习以后,对内容的了解更加深刻。
代码行数(新增/累积) | 博客量(新增/累积) | 学习时间(新增/累积) | 重要成长 | |
---|---|---|---|---|
目标 | 5000行 | 30篇 | 400小时 | |
第一周 | 200/200 | 2/2 | 20/20 | |
第二周 | 300/500 | 2/4 | 18/38 | |
第三周 | 500/1000 | 3/7 | 22/60 | |
第四周 | 300/1300 | 2/9 | 30/90 | |
第五周 | 300/1300 | 2/9 | 30/90 | |
第六周 | 543/1300 | 2/9 | 30/90 | |
第七周 |
尝试一下记录「计划学习时间」和「实际学习时间」,到期末看看能不能改进本身的计划能力。这个工做学习中很重要,也颇有用。 耗时估计的公式 :Y=X+X/N ,Y=X-X/N,训练次数多了,X、Y就接近了。
计划学习时间:XX小时
实际学习时间:XX小时
改进状况:
(有空多看看现代软件工程 课件 软件工程师能力自我评价表)