Advanced Java - Serialization & Reflection

10 Questions | Total Attempts: 249

SettingsSettingsSettings
Please wait...
Advanced Java Quizzes & Trivia

A quiz to assess the understanding of the Adv Java session in Serialization


Questions and Answers
  • 1. 
    How many methods does Serializable have?
    • A. 

      One

    • B. 

      Two

    • C. 

      Three

    • D. 

      None

  • 2. 
    SerialVersionUID of a class is subject to change if not defined by user
    • A. 

      Yes

    • B. 

      No

  • 3. 
    While serializing you want some of the members not to serialize? How do you achieve it?
    • A. 

      By declaring variable static

    • B. 

      Be declaring variable transient

    • C. 

      Both of the above

    • D. 

      None of the above

  • 4. 
    What will happen if one of the members in the class doesn't implement Serializable interface?
    • A. 

      Will throw compilation time issue

    • B. 

      Will throw run time exception

    • C. 

      Will serialize all members except non serializable membe

    • D. 

      None of the above

  • 5. 
    Can you customize Serialization process or can you override default Serialization process in Java?
    • A. 

      Yes

    • B. 

      No

  • 6. 
    Suppose super class of a new class implement Serializable interface, how can you avoid new class to being serialized?
    • A. 

      Not possible

    • B. 

      Implement writeObject() and readObject() method in your Class and need to throw NotSerializableException from those method.

  • 7. 
    Can we transfer a Serialized object via network
    • A. 

      Yes

    • B. 

      No

  • 8. 
    Keeping long variable names can be costly from performance perspective while serializing and de-serializing objects
    • A. 

      Yes

    • B. 

      No

    • C. 

      Does Not Matter

  • 9. 
    Can excessive use of reflection incur performance cost?
    • A. 

      Yes

    • B. 

      No

  • 10. 
    True or False: To serialize an array or a collection all the members of it must be serializable
    • A. 

      True

    • B. 

      False

Back to Top Back to top