You are on page 1of 13

GOVERNMENT POLYTECHNIC, NANDURBAR

COMPUTER ENGINEERING DEPARTMENT


Unit Test – I
Course Name: COMPUTER ENGINEERING Course Code: CO5I
Semester: Five(2022-23) Subject Title: AJP Subject Code: 22517
Time: 1 Hour Marks: 20

1) Where are the following four methods commonly used?

1) public void add(Component c)


2) public void setSize(int width,int height)

3) public void setLayout(LayoutManager m)


4) public void setVisible(boolean)

a. Graphics class
b. Component class

c. Both A & B
d. None of the above

ANSWER: Component class

Explanation:

No explanation is available for this question!

2) Implement the Listener interface and overrides its methods is required to perform in event handling.

a. True

b. False
Answer Explanation

ANSWER: True

Explanation:
GOVERNMENT POLYTECHNIC, NANDURBAR
COMPUTER ENGINEERING DEPARTMENT
Unit Test – I
Course Name: COMPUTER ENGINEERING Course Code: CO5I
Semester: Five(2022-23) Subject Title: AJP Subject Code: 22517
Time: 1 Hour Marks: 20

No explanation is available for this question!

3) Which is the container that doesn't contain title bar and MenuBars but it can have other components

button, textfield etc?

a. Window

b. Frame

c. Panel
d. Container
Answer Explanation

ANSWER: Panel

Explanation:

No explanation is available for this question!

4) These two ways are used to create a Frame

By creating the object of Frame class (association)

By extending Frame class (inheritance)

a. True

b. False
Answer Explanation

ANSWER: True
GOVERNMENT POLYTECHNIC, NANDURBAR
COMPUTER ENGINEERING DEPARTMENT
Unit Test – I
Course Name: COMPUTER ENGINEERING Course Code: CO5I
Semester: Five(2022-23) Subject Title: AJP Subject Code: 22517
Time: 1 Hour Marks: 20

Explanation:

No explanation is available for this question!

5) Give the abbreviation of AWT?

a. Applet Windowing Toolkit

b. Abstract Windowing Toolkit


c. Absolute Windowing Toolkit

d. None of the above


Answer Explanation

ANSWER: Abstract Windowing Toolkit

Explanation:

No explanation is available for this question!

6) Which method is used to set the graphics current color to the specified color in the graphics class?

a. public abstract void setFont(Font font)


b. public abstract void setColor(Color c)

c. public abstract void drawString(String str, int x, int y)


d. None of the above
Answer Explanation

ANSWER: public abstract void setColor(Color c)

Explanation:
GOVERNMENT POLYTECHNIC, NANDURBAR
COMPUTER ENGINEERING DEPARTMENT
Unit Test – I
Course Name: COMPUTER ENGINEERING Course Code: CO5I
Semester: Five(2022-23) Subject Title: AJP Subject Code: 22517
Time: 1 Hour Marks: 20

No explanation is available for this question!

7) The Java Foundation Classes (JFC) is a set of GUI components which simplify the development of d

applications.

a. True

b. False
Answer Explanation

ANSWER: True

Explanation:

No explanation is available for this question!

8) In Graphics class which method is used to draws a rectangle with the specified width and height?

a. public void drawRect(int x, int y, int width, int height)

b. public abstract void fillRect(int x, int y, int width, int height)

c. public abstract void drawLine(int x1, int y1, int x2, int y2)

d. public abstract void drawOval(int x, int y, int width, int height)


Answer Explanation

ANSWER: public void drawRect(int x, int y, int width, int height)

Explanation:

No explanation is available for this question!


GOVERNMENT POLYTECHNIC, NANDURBAR
COMPUTER ENGINEERING DEPARTMENT
Unit Test – I
Course Name: COMPUTER ENGINEERING Course Code: CO5I
Semester: Five(2022-23) Subject Title: AJP Subject Code: 22517
Time: 1 Hour Marks: 20

9) Which object can be constructed to show any number of choices in the visible window?

a. Labels

b. Choice

c. List

d. Checkbox
Answer Explanation

ANSWER: List

Explanation:

No explanation is available for this question!

10) Which is used to store data and partial results, as well as to perform dynamic linking, return values

methods, and dispatch exceptions?

a. Window

b. Panel

c. Frame
d. Container
Answer Explanation

ANSWER: Frame

Explanation:

11) Which class is used for this Processing Method processActionEvent( )?

-
GOVERNMENT POLYTECHNIC, NANDURBAR
COMPUTER ENGINEERING DEPARTMENT
Unit Test – I
Course Name: COMPUTER ENGINEERING Course Code: CO5I
Semester: Five(2022-23) Subject Title: AJP Subject Code: 22517
Time: 1 Hour Marks: 20

a. Button,List,MenuItem

b. Button,Checkbox,Choice

c. Scrollbar,Component,Button

d. None of the above

Answer Explanation

ANSWER: Button,List,MenuItem

Explanation:

No explanation is available for this question!

12) Which method can set or change the text in a Label?

a. setText()

b. getText()

c. All the above

d. None of the above

Answer Explanation

ANSWER: setText()

Explanation:

No explanation is available for this question!


GOVERNMENT POLYTECHNIC, NANDURBAR
COMPUTER ENGINEERING DEPARTMENT
Unit Test – I
Course Name: COMPUTER ENGINEERING Course Code: CO5I
Semester: Five(2022-23) Subject Title: AJP Subject Code: 22517
Time: 1 Hour Marks: 20

13) Which is a component in AWT that can contain another components like buttons, textfields, labels

a. Window

b. Container

c. Panel

d. Frame

Answer Explanation

ANSWER: Container

Explanation:

No explanation is available for this question!

14) AWT has more powerful components like tables, lists, scroll panes, color chooser, tabbed pane etc

a. True

b. False

Answer Explanation

ANSWER: True

Explanation:

No explanation is available for this question!


GOVERNMENT POLYTECHNIC, NANDURBAR
COMPUTER ENGINEERING DEPARTMENT
Unit Test – I
Course Name: COMPUTER ENGINEERING Course Code: CO5I
Semester: Five(2022-23) Subject Title: AJP Subject Code: 22517
Time: 1 Hour Marks: 20

15) Which are passive controls that do not support any interaction with the user?

a. Choice

b. List

c. Labels

d. Checkbox

ANSWER: Labels

16) How many types of controls does AWT support?

a. 7 b. 6 c. 5 d. 8

ANSWER: 7

17) The following

a) It is lightweight.

b) It supports pluggable look and feel.


GOVERNMENT POLYTECHNIC, NANDURBAR
COMPUTER ENGINEERING DEPARTMENT
Unit Test – I
Course Name: COMPUTER ENGINEERING Course Code: CO5I
Semester: Five(2022-23) Subject Title: AJP Subject Code: 22517
Time: 1 Hour Marks: 20

c) It follows MVC (Model View Controller) architecture

are the advantages of _____ .

a. Swing

b. AWT

c. Both A & B

d. None of the above

Answer Explanation

ANSWER: Swing

Explanation:

No explanation is available for this question!

18) The ActionListener interface is not used for handling action events.

a. True

b. False

Answer Explanation

ANSWER: False

Explanation:

No explanation is available for this question!


GOVERNMENT POLYTECHNIC, NANDURBAR
COMPUTER ENGINEERING DEPARTMENT
Unit Test – I
Course Name: COMPUTER ENGINEERING Course Code: CO5I
Semester: Five(2022-23) Subject Title: AJP Subject Code: 22517
Time: 1 Hour Marks: 20

19) Which package provides many event classes and Listener interfaces for event handling?

a. java.awt

b. java.awt.Graphics

c. java.awt.event

d. None of the above

Answer Explanation

ANSWER: java.awt.event

Explanation:

No explanation is available for this question!

20) Swing is not a part of JFC (Java Foundation Classes) that is used to create GUI application

a. True

b. False

Answer Explanation

ANSWER: False

Explanation:

No explanation is available for this question!


GOVERNMENT POLYTECHNIC, NANDURBAR
COMPUTER ENGINEERING DEPARTMENT
Unit Test – I
Course Name: COMPUTER ENGINEERING Course Code: CO5I
Semester: Five(2022-23) Subject Title: AJP Subject Code: 22517
Time: 1 Hour Marks: 20

21) The Following steps are required to perform

1) Implement the Listener interface and overrides its methods


2) Register the component with the Listener

a. Exception Handling

b. String Handling

c. Event Handling

d. None of the above

Answer Explanation

ANSWER: Event Handling

Explanation:

No explanation is available for this question!

22) Where can the event handling code be written?

a. Same class

b. Other class

c. Anonymous class
GOVERNMENT POLYTECHNIC, NANDURBAR
COMPUTER ENGINEERING DEPARTMENT
Unit Test – I
Course Name: COMPUTER ENGINEERING Course Code: CO5I
Semester: Five(2022-23) Subject Title: AJP Subject Code: 22517
Time: 1 Hour Marks: 20

d. All mentioned above

Answer Explanation

ANSWER: All mentioned above

Explanation:

No explanation is available for this question!

23) Which class provides many methods for graphics programming?

a. java.awt

b. java.Graphics

c. java.awt.Graphics

d. None of the above

Answer Explanation

ANSWER: java.awt.Graphics

Explanation:

No explanation is available for this question!

24) AWT is used for GUI programming in java

a. True
GOVERNMENT POLYTECHNIC, NANDURBAR
COMPUTER ENGINEERING DEPARTMENT
Unit Test – I
Course Name: COMPUTER ENGINEERING Course Code: CO5I
Semester: Five(2022-23) Subject Title: AJP Subject Code: 22517
Time: 1 Hour Marks: 20

b. False

Answer Explanation

ANSWER: True

Explanation:

No explanation is available for this question!

25) The ActionListener interface is not used for handling action events

a. True

b. False

ANSWER: False

You might also like