问题 单项选择题

下列说法中错误的一项是 ( )

A.实现完全串行化的类必须实现writeExternal()方法

B.readexternal()方法用于从对象流中读取通过writeExternal()方法写入的对象的数据

C.实现完全串行化的类必须定义一个具有public访问权限的不带参数的构造方法

D.writeExternal()方法的访问权限是private

答案

参考答案:D

解析: 实现完全定制串行化的类要遵守以下原则:(1)必须实现java.io.Externalizable接口;(2)必须实现writeExternal()方法以保存对象的数据或状态。并且该类必须负责把对象的各个超类的数据保存到流中;(3)必须实现readExternal()方法,该方法从对象流中读取通过writeExternal()方法写入的对象的数据,同时还必须恢复父类中的数据;(4)如果对象串行化中使用丁外部定义的格式,则writeExternal()方法和readExternal()方法都必须完全依照该格式;(5)必须定义一个具有public访问权限的不带参数的构造方法。选项A、B和C都是正确的,所以选项D是错误的。

完形填空
完形填空(本题有10小题, 每小题1分,共10分)
Problems in the neighborhood
Good morning,ladies and gentlemen,
Today,I am very happy to have a meeting with you.At the meeting we will talk about the __1__ we have these days.We all know the problems of __2__ and the objects failing from windows are getting worse.We have received lots of letters about such problems.So __3__ is time for possible ways to work out these problems.
Some dog—owners don’t take care of their dogs well enough,and they let their dogs make mess on the roads and in gardens、This makes the environment __4__.I would like to tell the dog—owners __5__ their behavior is too bad,and at the same time they are making people feel unhappy.We should keep the environment __6__.
It is reported that some people __7__ rubbish out of the windows.It is dangerous because falling objects __8__ hurt others.It is against the law.We should put up a notice to teach people not to do so.If it is found,we will record the names and address of those people who throw objects.Then,a warning will be given and __9__ will be punished by law.
A safe and comfortable living environment is important to us.__10__ we try our best to carefor our community,it will be a good place to live in.Thank you for your coming.
小题1:
A.lessonsB.problemsC.classesD.films
小题2:
A.dogsB.birdsC.catsD.snakes
小题3:
A.thatB.itC.thisD.here
小题4:
A.noisyB.quietC.tidyD.dirty
小题5:
A.whatB.thatC.whereD.when
小题6:
A.pleasantB.importantC.usefulD.famous
小题7:
A.pullB.putC.throwD.take
小题8:
A.mayB.needC.have toD.should
小题9:
A.weB.youC.theyD.he
小题10:
A.IfB.Because.C.BeforeD.Unless
单项选择题 A1/A2型题