编译失败
两个对象被序列化
—个对象被序列化
运行时异常被抛出
第1题:
现自: class Car implements Serializable () class Ford extends Car {} 如果试图序列化一个Ford实例,结果为()
第2题:
class Guy{String greet(){return “hi“}} class Cowboy extends Guy {String greet(){return“howdy”}} class Surfer extends Guy {String greet(){return“dudel”}} class Greetings{ public static void main (string[]args){ Guy[] guy= {new Guy(),new Cowboy(),new Surfer()}; for(Guy 0: guys) System.out.print(g.green()); } } 结果为:
第3题:
现自: 1. interface Color { } 2. interface Weight { } 3. //insert code here 和以下足六个声明: class Boat extends Color, extends Weight { } class Boat extends Color and Weight { } class Boat extends Color, Weight { } class Boat implements Color, implements Weight { } class Boat implements Color and Weight { } class Boat implements Color, Weight { } 分别插入到第3行,有多少行可以编译? ()
第4题:
class Car implements Serializable { } class Ford extends Car { } 如果试图序列化一个Ford实例,结果为()
第5题:
现有: class ThreadBoth extends Threaa implements Runnable { public void run() (System.out.print("hi"); } public static voicl main (String [] args) { Thread tl=new ThreadBoth(): Thread t2 = new Thread (tl): tl.run(): t2.run(): } 结果为:()
第6题:
你正在定义个一叫做Certkiller的类,这个类包含如下内容. Certkiller类包含一个可以再对象上执行的叫做ProcessChildren的方法。 Cerkiller类的对象可以被序列化()
第7题:
适用于所有者字段的 OptionalField 属性。
应用,所以所有者字段的属性。
已实现 IFormatter 接口的自定义序列化的车辆类别。
做什么,因为在使用二进制序列化时,私营领域是永远不会保留。
第8题:
运行时异常被输出
第7行出现一个错误,编译失败
第8行出现一个错误,编译失败
hi hi hi
hi hawdy doude
第9题:
hi hi
hi
编译失败
运行时异常被抛出
第10题:
编译失败
一个对象被序列化
两个对象被序列化
运行时异常被抛出
第11题:
FileInputStream
FileReader
DataInputStream
ObjectInputStream
第12题:
编译失败
两个对象被序列化
—个对象被序列化
运行时异常被抛出
第13题:
现有: class Parser extends Utils { public static void main(String [] args) { System.out.print(new Parser().getInt("42")); } int getInt(String arg) { return Integer.parseInt(arg); } } class Utils { int getInt(String arg) throws Exception { return 42; } } 结果为()
第14题:
关于对象的序列化说法错误的是()。
第15题:
现有: class Guy {String greet() {return "hi"; } } class Cowboy extends Guy ( String greet() ( return "howdy ¨; ) ) class Surfer extends Guy (String greet() (return "dude! ";)) class Greetings { public static void main (String [] args) { Guy [] guys = ( new Guy(), new Cowboy(), new Surfer() ); for (Guy g: guys) System.out.print (g.greet()}; } } 结果为:()
第16题:
现有: class Pet implements Serializable { Collar c= new Collar(); } class Collar implements Serializable { collarPart cpl=new CollarPart ("handle"); CollarPart cp2=new CollarPart ("clip"); } class CollarPart implements Serializable() 如果Pet实例被序列化,则多少对象将被序列化?()
第17题:
class Parser extends Utils { public static void main(String [] args) { System.out.print(new Parser().getInt("42")); } int getInt(String arg) { return Integer.parseInt(arg); } } class Utils { int getInt(String arg) throws Exception { return 42; } } 结果为:()
第18题:
如果你被要求写一段代码读取一个序列化的对象,那么一般使用哪种Stream()
第19题:
42
编译失败。
无输出结果。
运行时异常被抛出。
第20题:
实现序列化的对象必须实现Serializable接口
实现序列化的对象必须自定义序列号
ObjectOutputStream中的writeObject()方法可以将对象写出
ObjectInputStream中的readObject()方法可以读取对象
第21题:
Apply the OnDeserializing attribute to the ProcessChildren method.
Specify that Certkiller Class implements the IDeserializationCallback interface.
Specify that Certkiller Class inherits from the ObjectManager class.
Apply the OnSerialized attribute to the ProcessChildren method.
Create a GetObjectData method that calls ProcessChildren.
Create an OnDeserialization method that calls ProcessChildren.
第22题:
0
1
2
3
第23题:
hi howdy dude!
运行时异常被抛出。
第7行出现一个错误,编译失败。
第8行出现一个错误,编译失败。
第24题:
0
1
2
3
4
5