第七周学习的主要内容是课本的第十二第十三章: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小时
改进状况:无