Aliensbrain
  • Home
  • Topics
  • Quizzes
  • Notebooks
  • Community
  • Sign in
  • programming languages Online Quiz - 194
  • public class Foo implements java.io.Serializable { Line1. pr...

public class Foo implements java.io.Serializable { Line1. private int x; Line2. public int getX() { return x; } Line 3.publicFoo(int x){this.x=x; } Line 4. private void writeObject( ObjectOutputStream s) Line 5. throws IOException { Line 6. // insert code here Line 7. } Line 8. } Which code fragment, inserted at line Line 6, will allow Foo objects to be correctly serialized and deserialized? A. s.writeInt(x); B. s.serialize(x); C. s.writeObject(x); D. s.defaultWriteObject();

technology programming languages
  1. A

  2. B

  3. C

  4. D


Show answer
Correct Option: D

Find more quizzes:

© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy