当前位置:编程学习 > JAVA >>

考试题

Which piece of code will allow this class to be correctly serialzed and desirialized?  
 

import java.io.*;
 
public class Car implements Serializable {
        public int speeds;
        public int wheels;
 
        private void writeObject(ObjectOutputStream oos) 
                        throws IOException {
                oos.writeInt(speeds);
                oos.writeInt(wheels);
        }
 
        private void readObject(ObjectInputStream ois) 
                        throws IOException {
                . . . . . . Place here . . . . . .
        }
}




1.this = ois.defaultReadObject();
2.speeds = ois.readInt(); 
3.wheels = ois.readInt();
4.wheels = ois.readInt(); 
5.speeds = ois.readInt();
6.ois.defaultReadObject(); --------------------编程问答-------------------- Write a method that takes in a sentence and find the word that occurs the most. --------------------编程问答-------------------- 2,3  



. --------------------编程问答-------------------- thank you! --------------------编程问答-------------------- --------------------编程问答-------------------- 你是Y2的还是S2的。代码看不懂。呵呵
补充:Java ,  Java SE
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,