Java Stream Question and Answers

17. What happens to the object references included in the object?
 
  • The serialization mechanism generates an object graph for serialization.
  • Thus it determines whether the included object references are serializable or not, this is a recursive process.
  • Thus when an object is serialized, all the included objects are also serializable along with the original object.
 
Your Name Your Email-ID
Your Answer
18. How to make a class or a bean serializable?
 
  • By implementing either the java.io.Serializable interface, or the java.io.Externalizable interface.
  • As long as one class in a class's inheritance hierarchy implements Serializable or Externalizable, that class is serializable.
 
Your Name Your Email-ID
Your Answer
19. What is the difference between the file and random access file classes?
 
  • The File class encapsulates the files and directories of the local file system.
  • The RandomAccessFile class provides the methods needed to directly access data contained in any part of a file.
 
Your Name Your Email-ID
Your Answer
20. How many methods in the serializable interface?
 
  • There is no method in the serializable interface.
  • The serializable interface acts as a marker, telling the object serialization tools that your class is serializable.
 
Your Name Your Email-ID
Your Answer
123456 Page 5 of 6