问题 单项选择题

下面关于串行化的说法中正确的是( )。
Ⅰ:对象串行化机制需要将对象的状态保存到文件中,而后能够通过读入对象状态来重新构造对象,恢复程序状态。
Ⅱ:通过让类实现java.io.Serializable接口可以将类串行化。这个接口是一个制造者(marker)接口。也就是说,对于要实现它的类来说,该接口不需要实现任何方法。
Ⅲ:将对象读出或者写入流的主要类有两个:ObjectOutputStream与ObjectInputStream。
Ⅳ:以上都不对。

A) Ⅱ、Ⅲ
B) Ⅱ、Ⅳ
C) Ⅰ、Ⅱ、Ⅲ
D) Ⅲ、Ⅳ

答案

参考答案:C

解析: 本题是考查串行化的概念。对象串行化机制需要将对象的状态保存到文件中,而后能够通过读入对象状态来重新构造对象,恢复程序状态,对使用套接字在网络上传送对象的程序来说,是很有用的。通过让类实现 java.io.Serializable接口可以将类串行化。这个接口是一个制造者(marker)接口。也就是说,对于要实现它的类来说,该接口不需要实现任何方法。它主要用来通知Java虚拟机(JVM),将一个对象串行化。ObjectOutputStrcam提供用来将对象写入输出流的writeObject方法, ObjectlnputStrcam提供从输入流中读出对象的 readObject方法。

阅读理解

阅读理解。

Dear Changde Teacher Friends, 

    In my last email I forgot to mention one of the most important days of the year. National Teacher

Appreciation (感恩) Day! It is May 6 and kids all over America will bring a gift to their teachers on

that day. Traditionally, the little kids would bring a red apple for the teacher. Now, however, they

bring all kinds of gifts-flowers, fruit, candy, gift cards, and general appreciation cards. I'd like to

say a BIG "Thank you!" for all you do for your students. You have one of the most important jobs

-influencing the minds of young people. I am sure that all of you have done much to your students!

Keep up your good work!

    Here I give you a gift (Look at the picture). I wish I could give you a real one.

    Happy Teacher Appreciation Day! 

                                                                                                                           Sincerely, 

                                                                                                                           David Karber

1. National Teacher Appreciation Day is ______. [ ]

A. September 10

B. June 1

C. May 6

2. Kids will take ______ to teachers on National Teacher Appreciation Day. [ ]

A. gifts

B. apples

C. flowers

3. What did David mainly talk about in this email? [ ]

A. Some gifts for the teachers.

B. One of the most important jobs.

C. National Teacher Appreciation Day.

4. From this email, we know ______. [ ]

A. the job as a teacher in America is not important

B. David Karber has some teacher friends in Changde

C. Changde teacher friends received some real gifts from David Karber

单项选择题