Core Java Interview Questions – Set 04

What is the immediate superclass of Menu

MenuItem.

What is the purpose of a statement block

A statement block is used to organize a sequence of statements as a single statement group.

What is a native method?

A native method is a method that is implemented in a language other than Java

Which containers use a Border layout as their default layout

Window, Frame and Dialog classes use a BorderLayout as their layout.

What is the use if “instanceof” keyword ?

instanceof” keyword is used to check what is the type of object. F

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.

What is the difference between a MenuItem and a CheckboxMenuItem

The CheckboxMenuItem class extends the MenuItem class to support a menu item that may be checked or unchecked

What is the difference between TCP/IP and UDP?-

TCP/IP is a two-way communication between the client and the server and it is a reliable and there is a confirmation regarding reaching the message to the destination. It is like a phone call. UDP is a one-way communication only between the client and the server and it is not a reliable and there is no confirmation regarding reaching the message to the destination. It is like a postal mail.

What is the GregorianCalendar class?

The GregorianCalendar class provides support for traditional Western calendars

Which class should you use to obtain design information about an object?

The Class class is used to obtain information about an object’s design