AJP

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

1) Which is a special type of program that is embedded in the webpage to generate the dynamic

content?

A) Package
B) Applet
C) Browser
D) None of the above

2) Applet runs inside the browser and works at client side?

A) True
B) False

3) In the following statements which is a drawback for Applet?

A) It works at client side so less response time


B) Secured
C) It can be executed by browsers running under many platforms, including Linux, Windows,
and Mac Os etc.
D) Plugin is required at client browser to execute applet

4) The java.applet.Applet class 4 life cycle methods and java.awt.Component class provides
how many life cycle methods for an applet?

A) 2
B) 3
C) 1
D) 4

5) Which life cycle method of an applet java.awt.Component class provides?

A) public void paint(Graphics g)


B) public void destroy()
C) public void stop()
D) public void init()
6) Which is invoked after the init() method or browser is maximized?

A) public void start()


B) public void paint(Graphics g)
C) Public void stop()
D) Public void init()

7) Which is the correct order for lifecycle of an applet?

A) Applet is intialized,started,painted,destroyed,stopped
B) Applet is painted,started,stopped,initilaized,destroyed
C) Applet is initialized,started,painted,stopped,destroyed
D) None of the above

8) To run an Applet which of these used?

A) By html file
B) By AppletViewer tool(for testing purpose)
C) Both A & B
D) None of the above

9) Java Plug-in software is not responsible to manage the lifecycle of an Applet?

A) True
B) False

10) java.applet defines how many interfaces?

A) 2
B) 3
C) 4
D) 5

11) Which Called when an applet begins execution, It is the first method called for any applet?

A) void init()
B) void destroy()
C) boolean isActive()
D) None of the above
12) When an applet begins, the AWT calls the following methods, in this sequence?

A) init(),paint(),start()
B) Start(),paint(),init()
C) intit(),start(),paint()
D) paint(),start(),init()

13) when an applet is terminated the following sequence of methods calls takes place?

A) stop(),paint(),destroy()
B) destroy(),stop(),paint()
C) destroy(),stop()
D) stop(),destroy()

14) This method is used to suspend threads that don’t need to run when the applet is not
visible?

A) destroy()
B) paint()
C) stop()
D) start()

15) Which method is called only once during the run time of your applet?

A) stop()
B) paint()
C) init()
D) destroy()

16) The APPLET tag is used to start an applet from both an HTML document and from an
applet viewer?

A) True
B) False

17) Which is a required attribute that gives the name of the file containing your applet’s
compiled .class file?

A) CODE
B) CODEBASE
C) ALT
D) NAME
18) Applet works at client side so less response time?

A) True
B) False

19) Applet runs inside the browser and does not works at client side?

A) True
B) False

20) In Applet which are common security restrictions?

A) Applets can't load libraries or define native methods


B) An applet can't read every system property
C) Applets can play sounds
D) Both A & B

21) Which Invoked immediately after the start() method, and also any time the applet needs to
repaint itself in the browser?

A) stop()
B) init()
C) paint()
D) destroy()

22) An applet can play an audio file represented by the AudioClip interface in the java.applet
package. The AudioClip interface has how many methods?

A) 2
B) 3
C) 1
D) 4

23) An applet can play an audio file represented by the AudioClip interface in the java,applet
package Causes the audio clip to replay continually in which method?

A) public void play()


B) public void loop()
C) public void stop()
D) None of the above
24) The following example shows the creation of a
import java.applet.*;
import java.awt.*;

public class Main extends Applet{


public void paint(Graphics g){
g.drawString("Welcome in Java Applet.",40,20);
}
}

A) Banner using Applet


B) Basic Applet
C) Display clock
D) None of the above

25) Applets cannot make network connection exception to the server host from which it
originated?

A) True
B) False

1) Give the abbreviation of AWT?

A) Applet Windowing Toolkit


B) Abstract Windowing Toolkit
C) Absolute Windowing Toolkit
D) None of the above

2) Which is the container that contain title bar and can have MenuBars. It can have other
components like button, textfield etc.?

A) Panel
B) Frame
C) Window
D) Container

3) Which is a component in AWT that can contain another components like buttons, textfields,
labels etc.?

A) Window
B) Container
C) Panel
D) Frame
4) AWT is used for GUI programming in java?

A) True
B) False

5) The following specifies the advantages of

It is lightweight.
It supports pluggable look and feel.
It follows MVC (Model View Controller) architecture.

A) Swing
B) AWT
C) Both A & B
D) None of the above

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

A) True
B) False

7) Which class provides many methods for graphics programming?

A) java.awt
B) java.Graphics
C) java.awt.Graphics
D) None of the above

8) 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
9) 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

10) In which places can put the event handling code

A) Same class
B) Other class
C) Annonymous class
D) All mentioned above

11) 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

12) To use the ActionListener interface it must be implemented by a class there are several
ways to do that find in the following?

A) Creating a new class


B) using the class the graphical component
C) an anonymous inner class
D) All mentioned above

13) The ActionListener interface is not used for handling action events?

A) True
B) False

14) The ActionListener interface is used for handling action events, For example, it's used by a

A) JButton
B) JCheckbox
C) All of these
D) JMenuItem
15) Which is the container that doesn't contain title bar and MenuBars. It can have other
components like button, textfield etc?

A) Window
B) Frame
C) Panel
D) Container

16) How many types of controls does AWT supports these controls are subclasses of
component?

A) 7
B) 6
C) 5
D) 8

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

A) Choice
B) List
C) Labels
D) Checkbox

18) By which method You can set or change the text in a Label?

A) setText()
B) getText()
C) Both A & B
D) None of the above

19) Which class is used to create a pop-up list of items from which the user may choose?

A) List
B) Choice
C) Labels
D) Checkbox

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

A) Labels
B) Choice
C) List
D) Checkbox
21) Which class is used for this Processing Method processActionEvent( )?

A) Button,List,MenuItem
B) Button,Checkbox,Choice
C) Scrollbar,Component,Button
D) None of the above

22) The Swing Component classes that are used in Encapsulates a mutually exclusive set of
buttons?

A) AbstractButton
B) ButtonGroup
C) JButton
D) ImageIcon

23) Which is used to store data and partial results, as well as to perform dynamic linking, return
values for methods, and dispatch exceptions?

A) Window
B) Panel
C) Frame
D) Container

24) The following way is used to create a frame is by creating the object of Frame class?

A) inheritance
B) association
C) Both A & B
D) None of the above

25) AWT more powerful components like tables, lists, scroll panes, color chooser, tabbed pane
etc.?

A) True
B) False
26) In Graphics class Which method is used to set the graphics current color to the specified
color?

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

27) These four methods commonly used in?

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

28) 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)

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

A) True
B) False

30) The Java Foundation Classes (JFC) is a set of GUI components which simplify the
development of desktop applications?

A) True
B) False

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy