第七週學習的主要內容是課本的第十二第十三章:html
「Lambda 表達式」(lambda expression)是一個匿名函數,Lambda表達式基於數學中的λ演算得名,直接對應於其中的lambda抽象(lambda abstraction),是一個匿名函數,即沒有函數名的函數。Lambda表達式能夠表示閉包(注意和數學傳統意義上的不一樣)。java
函數式接口:Functional Interface.
定義的一個接口,接口裏面必須 有且只有一個抽象方法 ,這樣的接口就成爲函數式接口。在可使用lambda表達式的地方,方法聲明時必須包含一個函數式的接口。任何函數式接口均可以使用lambda表達式替換。git
Java中6個時間類:
java.util.Date java.sql.Date java.sql.Time java.sql.Timestamp java.text.SimpleDateFormat java.util.Calendarsql
java.util.Date、java.util.Calendar、java.sql.Timestamp具備的時間日期組件(並且他們具備無參構造方法),java.sql.Date和java.sql.Time只有時間或日期組件。express
Date 對象表示時間的默認順序是星期、月、日、小時、分、秒、年。若須要修改時間顯示的格式可使用「SimpleDateFormat(String pattern)」方法。閉包
首先主要是和本身的結對對象討論一些教材前幾章的問題,回顧了一下類的繼承,classpath的設置,構造函數等方面內容。app
在使用Lambda 表達式時,對於語法的記憶一直掌握不太牢固,經過敲網上的一些博客上的代碼,練習了一下函數
-cp bin/07
,設置好class路徑。public class ThreadTest { public static void main(String args[]){ MyThread myThread =new MyThread(); Thread t1=new Thread(myThread); Thread t2=new Thread(myThread); t1.start(); t2.start(); } } class MyThread extends Thread { ... }
A .1
B .2
C .3
D .4
正確答案: C
個人答案: B
分析:除了t1,t2, 還有main所在的主線程。學習
調用線程的interrupt()方法 ,會拋出()異常對象?
A .IOException
B .IllegalStateException
C .RuntimeException
D .InterruptedException
E .SecurityException
正確答案: D E
個人答案: D
分析:查看幫助文檔ui
Given an instance of a Stream, s, and a Collection, c, which are valid ways of creating a parallel stream? (Choose all that apply.)
給定一個Stream的實例s, 一個Collection的實例c, 下面哪些選項能夠建立一個並行流?
A .new ParallelStream(s)
B .c.parallel()
C .s.parallelStream()
D .c.parallelStream()
E .new ParallelStream(c)
F .s.parallel()
正確答案: D F
個人答案: B
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
個人答案: C E
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
個人答案: F
6.Assuming / is the root directory, which of the following are true statements? (Choose all that apply.)
A ./home/parrot is an absolute path.
B ./home/parrot is a directory.
C ./home/parrot is a relative path.
D .The path pointed to from a File object must exist.
E .The parent of the path pointed to by a File object must exist.
正確答案: A
個人答案: E
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
個人答案: C
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
個人答案: B D
A .BufferedInputStream
B .FileInputStream
C .BufferedWriter
D .ObjectInputStream
E .ObjectOutputStream
F .BufferedReader
正確答案: A D
個人答案: A B
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
教材學習中的問題和解決過程, 一個問題加1分
代碼調試中的問題和解決過程, 一個問題加1分
代碼行數(新增/累積) | 博客量(新增/累積) | 學習時間(新增/累積) | 重要成長 | |
---|---|---|---|---|
目標 | 5000行 | 15篇 | 400小時 | |
第一週 | 4/4 | 1/1 | 10/10 | |
第二週 | 20/24 | 1/2 | 9/19 | |
第三週 | 80/104 | 1/3 | 10/29 | |
第四周 | 343/ 447 | 1/4 | 15/44 | |
第五週 | 748/1195 | 1/5 | 20/64 | 可以本身敲出一些簡單的程序 |
第六週 | 207/1402 | 1/6 | 10/74 | 繼續敲出一些簡單的程序 |
第七週 | 241/1643 | 2/8 | 11/85 |
計劃學習時間:20小時
實際學習時間:11小時
改進狀況:無