JOIN ADRE 2.0 Telegram Group

Applets - Core Java Questions and Answers - MCQs with Answers

Questions
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.

Advertisement
Article and Schedule Quiz Start Test!

DOWNLOAD CURRENT AFFAIRS PDF FROM APP

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.

ADRE 2.0 FULL LENGTH MOCK TEST

Take Mock Tests

Missiles Mock Test Start Test!
SSC MTS Mock Test Start Test
IBPS CLERK MOCK TEST Start Test
SSC MTS 2022 JULY 26 Shift 1 (ENGLISH) Start Test!
SSC GD Previous Year Paper 2021 Nov 17 Shift - I (Hindi) Start Test!
SSC CGL Tier - 1 PYP 2022 April 21 Shift- 1 (ENGLISH) Start Test!
MPSC PAPER I MOCK TEST 1 (ENGLISH) Start Test!
IB Security Assistant Mock test 1 (english) Start Test!
UP POLICE CONSTABLE MOCK TEST 1 Start Test!
DELHI POLICE CONSTABLE MOCK TEST 1 (HINDI) Start Test!

Chapters

Advertisement