JOIN ADRE 2.0 Telegram Group

Applets - Core Java Questions and Answers - MCQs with Answers

1 Which of the following will be used to print your name in an applet?
A drawText (myName)
B drawLine (myName, 10. 10)
C drawLetters (10, 10, myName)
D drawString (myName, 10, 10)

Answer: Option [D]

drawString is a Graphics class. It called within update() or paint() method to print a string to the applet window.

2 The base class of the classes "Button" and "TestComponent" is
A Component
B Label
C Objects
D Container

Answer: Option [A]

The Component class is the base class for classes "Button" and "TestComponent". It is base class for almost all the interface components in the AWT.

APSC CCE PRELIMS Mock Test - 1 Start Test
APSC CCE PRELIMS Mock Test - 2 Start Test


3 Default layout manager for subclasses of "Window" is
A CardLayout
B GridBagLayout
C Frame
D BorderLayout

Answer: Option [D]

BorderLayout is the default layout manager for subclasses of "Window". For e.g. it default layout manager for JFrame, JWindow, JDialog, JInternalFrame, and JApplet.

4 Applet can be embedded in a
A MS Word document
B RTF file
C html file
D gif file

Answer: Option [C]

Applets are written in Java and it can be included in html page by using HTML tag.

5 What is the default layout for Dialogs ?
A FlowLayout
B BorderLayout
C CardLayout
D GridLayout

Answer: Option [B]

In a container BorderLayout is used to arrange components in five regions. The arrangement of components can be done by resizing and putting them in five regions North, South, East, West and Center.


Take Mock Tests

Government Schemes Mock Test Start Test!
Political Science Mock Test – 42 Start Test
History Test – 190 Start Test
Quantitative Aptitude Test Start Test!
Trigonometry - Mock Test Start Test!
Data Interpretation - Mock Test Start Test!
General Awareness - Mock Test Start Test!
Reasoning Ability - Mock Test Start Test!
Englist(Antonyms) Mock Test 1 Start Test!
Quantitative Aptitude (Percentage) Mock Test Start Test!
Economy Mock Test 1 Unlock Test!
Books & Authors - Test 2 Unlock Test!


apsc cce prelims 2024 test series