Question-131. Explain Set Interface ?

Answer- It is a collection of element which cannot contain duplicate elements. The Set interface contains only methods inherited from Collection and adds the restriction that duplicate elements are prohibited.

Question-132. What is the difference between object oriented programming language and object based programming language ?

Answer- Object based programming languages follow all the features of OOPs except Inheritance. JavaScript is an example of object based programming languages.

Question-133. What is the purpose of default constructor ?

Answer- The java compiler creates a default constructor only if there is no constructor in the class.

Question-134. Define function overloading ?

Answer- If a class has multiple functions by same name but different parameters, it is known as Method Overloading.

Question-135. Define function overriding ?

Answer- If a subclass provides a specific implementation of a method that is already provided by its parent class, it is known as Method Overriding.

Question-136. Why vector class is used ?

Answer- The Vector class provides the capability to implement a growable array of objects. Vector proves to be very useful if you don’t know the size of the array in advance, or you just need one that can change sizes over the lifetime of a program.

Question-137. What is the difference between window and frame ?

Answer- The Frame class extends Window to define a main application window that can have a menu bar.

Question-138. What is the difference between paint() and repaint() methods ?

Answer- The paint() method supports painting via a Graphics object. The repaint() method is used to cause paint() to be invoked by the AWT painting thread.

Question-139. What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy ?

Answer- The Reader/Writer class hierarchy is character-oriented, and the InputStream/OutputStream class hierarchy is byte-oriented.

Question-140. What is Serialization and Deserialization ?

Answer- Serialization is the process of writing the state of an object to a byte stream. Deserialization is the process of restoring these objects.