Java Stream Question and Answers

5. How many methods in the externalizable interface?
 
  • There are two methods in the externalizable interface.
  • You have to implement these two methods in order to make your class externalizable.
  • These two methods are read external() and write external().
 
Your Name Your Email-ID
Your Answer
6. What is the difference between Reader/Writer and InputStream/Output Stream?
  The Reader/Writer class is character oriented and the InputStream/OutputStream class is byte oriented.
 
Your Name Your Email-ID
Your Answer
7. What class allows you to read objects directly from a stream?
  The ObjectInputStream class supports the reading of objects from input streams.
 
Your Name Your Email-ID
Your Answer
8. What is a transient variable?
 
  • A transient variable is a variable that may not be serializable.
  • If you don't want some field to be serialized, you can mark the field transient or static.
 
Your Name Your Email-ID
Your Answer
123456 Page 2 of 6