Monday, 19 March 2012

Internet, Web Programming and Java MCQ 13


1.      An applet is a ___________ program.

a.       Large
b.      Small
c.       Medium
d.      None of these

2.      __________ refers to a command that allows you to run applets outside a web browser.

a.       JavaViewer
b.      AppletViewer
c.       PackageViewer
d.      None of these

3.      _________ denotes the variables that receive the values of the arguments passed into the method to provide the desired output.

a.       Integer
b.      Parameters
c.       Instance variables
d.      object

4.      Applets use various methods of _________ class and _______ class.

a.      Applet, Graphics
b.      Applet, Image
c.       Image, Graphics
d.      None of these

5.      The execution of an applet begins from the ________ method.

a.       int
b.      init( )
c.       init
d.      none of these

6.      For the execution of a local applet, an __________ connection is must.

a.       Internet
b.      Networking
c.       Both a & b
d.      None of these

7.      The sequence of methods invoked automatically when an applet is loaded till it is destroyed is:

a.       init(), paint(),start(),stop(),destroy()
b.      start(),init(),paint(),stop(),destroy()
c.       star(),paint(),init(),destroy(),stop()
d.      init(),start(),paint(),stop(),destroy()

8.      The _______ method is used to display a string on an applet.

a.      drawString()
b.      stringdraw()
c.       String()
d.      Draw()

9.      The following tags are mandatory while creating an html document to display an applet:
a.       NAME,CODE,HEIGHT
b.      CODEBASE,HEIGHT,WIDTH
c.       CODE,HEIGHT,WIDTH
d.      CODE,NAME
10.  The __________ attributes indicates the URL of the directory where the applet .class file resides.

a.      CODEBASE
b.      BASECODE
c.       NAMEBASE
d.      BASENAME





11.  The parameters can be passed to an applet by using <PARAM> tag in the following way:
a.      <PARAMNAME=parameter_name VALUE=parameter_value>
b.      PARAMNAME=parametername VALUE=parametervalue
c.       <PARAMNAME=parameter_name><VALUE=parameter_value>
d.      None of these
12.  What will be the output of the following code:
gra.drawLine(10,10,50,10);
a.       A vertical line that is 40 pixels long
b.      A vertical line that is 50 pixels long
c.       A horizontal line that is 40 pixels long
d.      A horizontal line that is 50 pixels long
13.  Which of the following is not a method of Graphics class:

a.       drawRectangle()
b.      fillCircle()
c.       drawArc()
d.      drawEllipse()
e.      Both b & d

14.  The code given below a line.what will be the color of line:
g.setColor (color.red.yellow.green.cyan.blue)
gra.drawLine (20, 20, 20, 70)

a.       Black
b.      Blue
c.       Red
d.      Green

15.  Write a statement to construct a20-point bold Serif font.
a.      new Font(“Serif ”, Font.BOLD,20);
b.      new Font(Serif , Font 20);
c.       new (“Serif”, Font.BOLD,20);
d.      new Font(“Serif”,20);
16.  The __________ method of the graphics class is used to draw an image on an applet.

a.       drawGraphic()
b.      drawImage()
c.       drawPic()
d.      None of these

17.  The java programs that have been discussed so far are _________ application programs.

a.      Console-based
b.      Object-based
c.       Public-based
d.      Method-based

18.  The most significant features of an applet is that it transforms a _____________ user interactive webpage by adding images, animations, different text styles to it.
a.       Dynamic webpage into a static
b.      Static webpage into a dynamic
c.       Static webpage into a html
d.      None of these
19.  In other words, applets help a programmer to develop a full-featured _________ application.

a.       Documents
b.      Networking
c.       Multimedia
d.      None of these





20.  The java applets can be executed either through an ___________ (a tool of java development kit) or any java-compatible Web browser.

a.      AppletViewer
b.      Javac
c.       JavaViewer
d.      jdk*

21.  Applet can be classified into ____ types:

a.       3
b.      4
c.       2
d.      6

22.  The _______ class is responsible for all the operations related to display (output) of an applet.

a.      Graphics
b.      Images
c.       Objects
d.      Main

23.  Life cycle of an applet:
a.       Running, idle, born, dead
b.      Idle, running, born, dead
c.       Born, running, idle, dead
d.      Running, dead, born, idle
24.  The life cycle of an applet begins when it is first loaded and the _______ method is invoked.

a.       start()
b.      paint()
c.       init()
d.      stop()

25.  _________ method is invoked to display the output on the screen in the form of text, graphics etc.

a.       graphics()
b.      paint()
c.       image()
d.      init()

26.  __________ method is invoked to remove the applet permanently from the memory.

a.       clear()
b.      clean()
c.       destroy()
d.      dead()

27.  An HTML document is a collection of ________ .

a.       Images
b.      Text
c.       Sheets
d.      None of these

28.   Every HTML document can be broadly divided into ________ major elements.

a.       Three
b.      Four
c.       Five
d.      Two 

29.  ________ element marks the beginning and ending of the HTML document.

a.       HEAD
b.      TITLE
c.       HTML
d.      BODY

30.  The syntax of HTML element is as follows:

a.      <html>……..</html>
b.      </html>…….<html>
c.       <html/>…….<html>
d.      <html>……..<html/>

31.  The syntax of HEAD element is as follows:

a.       </head>…….</head>
b.      <head>……..<\head>
c.       <head>…….</head>
d.      <head>……...<head>




32.  The BODY tag is placed exactly after the ______ tag.

a.       HTML
b.      HEAD
c.       TITLE
d.      BODY

33.  To build an applet, an applet code is _____ and ______.
a.      Created, compiled
b.      Interpreter, compiler
c.       Trace, debug
d.      None of these
34.  The ______ tag specifies the applet code that is to be loaded and at the same time, it tells the browser about its space requirement on the web page.

a.       </APPLET>
b.      <APPLET/>
c.       <APPLET>
d.      <AppletViewer>

35.  The text written in ____________ attribute will be displayed if the browser is unable to run the applet.

a.      ALT= alternate_text
b.      ALIGN=alignment
c.       NAME= applet_name
d.      None of these

36.  An AppletViewer is a tool of _________ which is specifically designed for viewing applets.

a.       bin
b.      java
c.       jdk
d.      javac

37.  Java allows user to pass ___________ parameters to an applet with the help of <PARAM> tags.

a.      user-defined
b.      well-defined
c.       system-defined
d.      none of these

38.  A rectangle can be drawn by using the ________ method.

a.       DrawRectangle()
b.      DrawRectangle
c.       drawrect[]
d.      drawRect()

39.  An ellipse can be drawn using the _______ method.

a.       Drawoval()
b.      drawOval()
c.       drawoval
d.      none of these


40.  The Color class contains three primitive colors, namely:

a.       Red, pink, green
b.      Red, blue, yellow
c.       Red, cyan, green
d.      Red, blue, green

1 comment :