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小時
改進狀況:
(有空多看看現代軟件工程 課件 軟件工程師能力自我評價表)