Languages-Java [3i Infotech Placement]: Sample Questions 62 - 63 of 141

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 62


Describe in Detail


What is serialization?


Understanding of Serialization
  • Serialization is a mechanism of converting the state of an object into a type stream.
  • It is used in Hibernate, RMI, EJB and JMS technologies.
  • An object is thus represented as a sequence of bytes that includes the object՚s data as well as information about the object՚s type and the types of data stored in the object.

Advantages of java serialization:

Mainly used to send object՚s state on the network.

Question 63




Final variables should be declared in the beginning?




  • True, final prevents modification of variable, but those have to be initialized at some point- constructor is the right place.
  • Value of a final variable can only be set once- constructor can guarantee this.
  • Constructor is called once for an object while other methods can be called any number of times.
  • A “blank final” instance variable of a class must be definitely assigned at the end of every constructor of the class in which it is declared.
  • A “blank final static” variable must be definitely assigned in a static initializer of the class.

Developed by: