Core Java Interview Questions and Answers for Freshers - 1

Question: 1

What is the purpose of repaint method?

repaint() requests can erase and redraw (update) after a small time display. When you invoke repaint()

Question: 2

What is the parameter specification for the public static void main method?

String args []

String [] args

Question: 3

What is the difference between the paint() and repaint() method?

The paint() method supports painting via a Graphics object.

The repaint() method is used o cause paint() to be invoked by the AWT painting thread.

Question: 4

What are the default layouts for a applet, a frame and a panel?

For an applet and a panel, Flow layout, and The FlowLayout manager attempts to honor the preferred size of any components.

Question: 5

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.

Related Questions