Core Java - Interview Questions and Answers

361. The System.err method is used to print error message.

Ans : True.

362. What is meant by StreamTokenizer?

Ans : StreamTokenizer breaks up InputStream into tokens that are delimited by sets of characters.
It has the constructor : StreamTokenizer(Reader inStream).
Here inStream must be some form of Reader.

363. What is Serialization and deserialization?

Ans : Serialization is the process of writing the state of an object to a byte stream.

364. Which of the following can you perform using the File class?
a) Change the current directory
b) Return the name of the parent directory
c) Delete a file
d) Find if a file contains text or binary information

Ans : b and c.

365. How can you change the current working directory using an instance of the File class called FileName?
a) FileName.chdir("DirName").
c) FileName.cwd("DirName").
d) The File class does not support directly changing the current directory.

Ans : d.


366. The event delegation model, introduced in release 1.1 of the JDK, is fully compatible with the
event model.
True / False

Ans : b.

367. A component subclass that has executed enableEvents( ) to enable processing of a certain kind of event cannot also use an adapter as a listener for the same kind of event.
True / False

Ans : b.

368. What is the highest-level event class of the event-delegation model?

Ans : The java.util.eventObject class is the highest-level class in the event-delegation hierarchy.

369. What interface is extended by AWT event listeners?

Ans : All AWT event listeners extend the java.util.EventListener interface.

370. What class is the top of the AWT event hierarchy?

Ans : The java.awt.AWTEvent class is the highest-level class in the AWT event class hierarchy.

Post a Comment

Mới hơn Cũ hơn