0

JAVA Applets

Description: Information Technology
Number of Questions: 26
Created by:
Tags: JAVA Programming
Attempted 0/26 Correct 0 Score 0

Which method of life cycle of an applet is used to perform clean-up operation?

  1. start() method

  2. stop() method

  3. destroy() method

  4. none of these


Correct Option: C
Explanation:

destroy() method is used to perform clean-up operation like closing a file.

Which of the following methods of life cycle of an applet initilizes variables, and add components like buttons and check boxes to the applet?

  1. init() method

  2. start() method

  3. stop() method

  4. destroy() method


Correct Option: A
Explanation:

init() method is used to initilize variables, and add components like buttons and check boxes to the applet.

Which method is called when the applet loses focus?

  1. init() method

  2. start() method

  3. stop() method

  4. destroy() method


Correct Option: C
Explanation:

stop() method is called every time when the applet loses the focus.

Which of the following methods is the first to be called when an applet is loaded into memory of computer?

  1. init() method

  2. stop() method

  3. destroy() method

  4. none of these


Correct Option: A
Explanation:

init() method is called the first time when an applet is loaded into the memory of the computer.

Which of the following methods of the painting is called to clear the screen and call the paint() method?

  1. update() method

  2. repaint() method

  3. paint() method

  4. none of these


Correct Option: A
Explanation:

update() method of the painting method is called to clear the screen and call the paint() method.

______________ method is used by the browser when user moves to another page.

  1. init()

  2. destroy()

  3. stop()

  4. none of these


Correct Option: B
Explanation:

destroy() method is called by the browser when the user moves to another page.

Which method of the painting is called when you want the applet area to be redrawn?

  1. paint() method

  2. repaint() method

  3. update() method

  4. none of these


Correct Option: B
Explanation:

repaint() method is called when you want the applet area to be redrawn.

Which event is generated when a component is added to or removed from container?

  1. Item Event

  2. Container Event

  3. Adjustment Event

  4. None of these


Correct Option: B
Explanation:

ContainerEvent is generated when a component is added to or removed from the container.

Which method of ItemEvent can be used to obtain reference to the ItemSelectable objects that generate an event?

  1. getItem()

  2. getItemSelectable()

  3. getStateChange()

  4. none of these


Correct Option: B
Explanation:

getItemSelectable() method can be used to obtain a reference to the ItemSelectable object that generate an event.

Which event is generated when a component gains or loses input focus?

  1. Focus Event

  2. Keyboard Event

  3. Text Event

  4. Mouse Event


Correct Option: A
Explanation:

FocusEvent is generated when a component gains or loses input focus.

In Java Programming Language, which classes implement the corresponding listener interfaces containing more than one method?

  1. Adapter classes

  2. Inner classes

  3. Anonymous classes

  4. Window classes


Correct Option: A
Explanation:

Java Programming language provide Adapter classes that implement the corresponding listener interface containing more than one method.

_________________ are the classes that do not need a name since you don't need them anywhere else in the program.

  1. Inner classes

  2. Adapter classes

  3. Anonymous classes

  4. None of these


Correct Option: C
Explanation:

Anonymous classes are the classes that you declare in a method which do not need a name since you do need them anywhere else in the program.

___________ are classes that are declared within other classes. They are also known as nested classes and provide additional clarity to the program.

  1. Inner classes

  2. Adapter classes

  3. Anonymous classes

  4. Text classes


Correct Option: A
Explanation:

Inner classes are classes that are declared within other classes. They are also known as nested classes and provide additional clarity to the program.

_____________ is the back bone of JDBC architecture.

  1. ODBC

  2. JDBC

  3. JDBC Driver Manager

  4. ZOBC


Correct Option: C
Explanation:

JDBC Driver Manager is the back bone of the JDBC architecture.

The _________ method executes a simple query and returns a single ResultSet object.

  1. executeUpdate()

  2. execute()

  3. executeQuery()

  4. none of these


Correct Option: C
Explanation:

executeQuery() method executes a simple query and returns a single ResultSet object.

Which of the following makes it possible to access any data from any application regardless of the fact that which database management system is handling the data?

  1. ODBC

  2. JDBC

  3. JDBC Driver Manager

  4. None of these


Correct Option: A
Explanation:

ODBC makes it possible to access any data from any application regardless of which database management system is handling the data.

Which of the following is used to connect a Java application to the approprite driver?

  1. JDBC Driver Manager

  2. ODBC

  3. JDBC

  4. None of these


Correct Option: A
Explanation:

JDBC Driver Manager is used to connect a Java application to the approprite driver.  

A connection object is initialized using the ___________ method.

  1. getConnection()

  2. createStatement()

  3. executeQuery()

  4. getQuery()


Correct Option: A
Explanation:

The connection object is initialized using the getConnection() method.

Which method executes an SQL INSERT, UPDATE or DELETE Statement?

  1. executeQuery()

  2. executeUpdate()

  3. execute()

  4. none of these


Correct Option: B
Explanation:

executeUpdate() method executes an SQL INSERT, UPDATE or DELETE statement.

______________ is generated by text fields and text areas when characters are entered by a user or program.

  1. Focus Event

  2. Item Event

  3. Text Event

  4. None of these


Correct Option: C
Explanation:

TextEvent is generated by text fields and text areas when characters are entered by a user or program.

Which method of MouseEvent obtains the number of mouse clicks for the event?

  1. translatePoint()

  2. getClickCount()

  3. isPopupTrigger()

  4. getitem()


Correct Option: B
Explanation:

getClickCount() method of MouseEvent obtains the number of mouse clicks for the event

Which component of an event is the object that generates the event?

  1. Event object

  2. Event source

  3. Event handler

  4. None of these


Correct Option: B
Explanation:

Event source is an object that generates an event.

_________ is generated when a button is pressed, a list item is double-clicked or a menu item is selected.

  1. Action Event

  2. Adjustment Event

  3. Component Event

  4. Container Event


Correct Option: A
Explanation:

Action Event is generated when a button is pressed, a list item is double-clicked or a menu item is selected.

Which of the following events is generated when the size, position or visibility of a component is changed?

  1. Adjustment Event

  2. Component Event

  3. Container Event

  4. Item Event


Correct Option: B
Explanation:

Component Event is generated when the size, position or visibility of a component is changed.

Which event is generated when a checkbox or a list item is clicked or when a check menu item is selected or deselected?

  1. Container Event

  2. Component Event

  3. Focus Event

  4. Item Event


Correct Option: D
Explanation:

Item Event is generated when a check box or a item list is clicked or when a check menu item is selected or deselected.

Which of the following user interfaces defines how should components be arranged in a container?

  1. Component

  2. Container

  3. Layout manager

  4. None of these


Correct Option: C
Explanation:

Layout manager defines how the components will be arranged in a container.

- Hide questions