Join our Telegram Channel

8000+ STATIC GK MCQs for SSC/ Railway/ PSC
1000 POLITICAL SCIENCE MCQS | EBook
Get 22 nos. GK EBooks | Combo Pack
Current Affairs Monthly Magazine -Subscribe Now!
1000 BIOLOGY MCQS AND ANSWERS | EBook
1000 ECONOMICS MCQS FOR EXAMS | EBook
Mughal Empire MCQs | EBook
ECONOMIC GEOGRAPHY MCQs | EBook
350 MCQs ON INDIAN CONSTITUTION | EBook

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

Advertisement

Chapters

General Knowledge

Month-wise Current Affairs 2022

Category-wise Current Affairs

Jobs by Qualification

Free Mock Test