Set - 3

Question 6 :

What class allows you to read objects directly from a stream?

Answer :

The ObjectInputStream class supports the reading of objects from input streams.


Question 7 :

How are this() and super() used with constructors?

Answer :

this() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor.


Question 8 :

How is it possible for two String objects with identical values not to be equal under the == operator? How are this() and super() used with constructors?

Answer :

The == operator compares two objects to determine if they are the same objects in memory. It is possible for two String objects to have the same value, but located in different areas of memory.


Question 9 :

What is an IO filter?

Answer :

An IO filter is an object that reads from one stream and writes to another, usually altering the data in some way as it is passed from one stream to another.


Question 10 :

What is the Set interface?

Answer :

The Set interface provides methods for accessing the elements of a finite mathematical set. Sets do not allow duplicate elements.