Core Java Interview Questions – Set 05

What is the return type of a program’s main() method?

A program’s main() method has a void return type.

Can you change the reference of the final object

No the reference cannot be change, but the data in that object can be changed

What is the argument type of a program’s main() method

A program’s main() method takes an argument of the String[] type.

What is a compilation unit

A compilation unit is a Java source code file.

What are the problems faced by Java programmers who don’t use layout managers?

Without layout managers, Java programmers are faced with determining how their GUI will be displayed across multiple windowing systems and finding a common sizing and positioning that will work within the constraints imposed by each windowing system.

Which class is extended by all other classes

The Object class is extended by all other classes.

Is a class a subclass of itself

A class is a subclass of itself.

Which containers may have a MenuBar

Frame.

What is the difference between a Scrollbar and a ScrollPane

A Scrollbar is a Component, but not a Container. A ScrollPane is a Container.

A ScrollPane handles its own events and performs its own scrolling.

When are the static variables loaded into the memory

: During the class load time