Programming in Java Nptel Answers

Week 8 Answers

1) Which of the following is TRUE regarding check box and radio button?
a) Check box is used for single selection item whereas radio button is used for multiple selection.
b) Check box is used for multiple selection items whereas radio button is used for single selection.
c) Both are used for multiple as well as single item selection.
d) Checkbox is always preferred than radio buttons.

Answer: B

2) Which of the following is the latest graphics and media package for Java?
a) Applet
b) AWT
c) Swing
d) JavaFX

Answer: D

3) Which of the following is/are NOT an exception of java.awt package?
a) HeadlessException
b) FontFormatException
c) IllegalStateException

Answer: D

4) Which of the following statement is FALSE about the update() in java.awt package?
a) Sets the color of the graphics context to be the foreground color of this component.
b) Calls this component’s paint method to completely redraw this component.
c) Updates the component by checking an online repository.
d) Clears this component by filling it with the background color.

Answer: C

5) Which of the following method is used to remove all items from scrolling list in java.awt.List?
a) hide()
b) remove()
c) clear()
d) close()

Answer: C

6) Which layout manager arranges components in a single row or column in Java?
a) FlowLayout
b) BorderLayout
c) GridLayout
d) CardLayout

Answer: A

7) What does “AWT” stand for in Java?
a) Abstract Widget Toolkit
b) Advanced Window Toolkit
c) Abstract Window Toolkit
d) Advanced Widget Toolkit

Answer: C

8) Which AWT component is used to create a button in a GUI?
a) Label
b) Button
c) TextField
d) Checkbox

Answer: B

9) Which of the following is TRUE about the following GUI?
First Name:
Last Name:
a) There is a Frame and two TextFields.
b) There is a Frame with two Labels and two non-editable TextFields.
c) There are two Labels.
d) There is a Frame with two Labels and two TextFields.

Answer: D

10) Which of the following is TRUE about check box in Java?
a) A check box can’t be in either an “on” (true) or “off” (false) state.
b) Clicking on a check box changes its state from “on” to “off,” or from “off” to “on.”
c) A check box can be in an “on” (true) and in “off” (false) state simultaneously.
d) Check boxes cannot be grouped together.

Answer: B

Share:

Categories

Archives

You May Also Like

1) Identify the cost estimation of a query evaluation plan, if 9000 blocks are required to be transferred from the...
Week 8 Answers 1. Work-family conflict is a form of inter-role conflict. Is the statement true? (a) True(b) False Answer...