Dynamic Webpage Design: Java Programming and
Dynamic Webpage Design: Java Programming and
Progra
[B.1
MCQ
JAVA PROGRAMMING AND
DYNAMIC WEBPAGE DESIGN
Java
Q.1. Java is a Successor to which programming
language?
(1) B (2) C
C+ (4) D
Ans.(3) C++
Explanation: C++ introduced O0Ps (Object Oriented
Programming) concepts which are adopted by Java.
9.2. Who invented Java language?
(1) Dennis Ritchie (2Y James Gosling
(3) Larry Page (4) Serge Page
Ans.(2) James Gosling
Explanation : James Gosling along with his team
members Mike Sheridan and Patrick Naughton developed
Java language.
Q.3. What is the original name of Java Programming
language?
(1) J++ (2) C++
0AK (4) TEAK
Ans. (3) OAK
Explanation: Java was named after an OAK tree outside
James Gosling's office.
4. Which laboratory was Java invented or developed
in?
(1) Bell Laboratory (2)Sun Microsystems
(3) Dennis Ritchie (Office (4) Johnson and Johnson
Ans. (2) Sun Microsystems
was also
Explanation: NFS (Network File System)
invented by SUN Microsystems.
amming and DynamicWeb Page Design
[B.2 KPH MCO Java
Pro B.3]
Q.5. The name "JAVA" is known to the world as?
for Bn theie
problem with generation Executable
(1) A Tea Brand in India (2) A Coffee Software (EXE files)?
Q12.h
Brand
A n Island in Indonesia (4) Ragi Malt Juic in Af. 1 Run only on Windows machines.
Ans. (3) An Island in Indonesia Afri (2) Linux and Unix expect a different executable
format
Explanation : Indonesia is a group of than EXE
with Java sea on one side. olcanic T.Islan
Volcanie
8) Compiler for each machine
type like
Q.6. Java Windows and Processor Type needs to Linux, Unix,
language was originally be built for
operating?
(1) TV
developed developed t generating output files that can run.
4 A l l the above.
(2) TV
(3) Embedded System equipment Set-top box
All the abova" Ans.(4) All the above
Ans. (4) All the above.
0.13.What is an Interpreter?
Q.7. What type of Java (1) An interpreter converts instructions line by line
Java supported Web Programs can be run inside (2) An Interpreter converts source code to low-level code
Browser?
(1) Stand alone (2) Struts (3) Interpreters are slow to execute
L Applets (4) AWT 4All the above
Ans. (3) Applets
Ans.(4) All the above
Q.8. Which company owns Explanation: Opposite of Interpreter is a Compiler.
(1) IBM Java at present?
(2) Microsoft Q.14.What is a Compiler?
(3) Sun Microsystems Oracle
Ans. (4) Oracle (1) A Compiler converts all instructions in one go.
(2) A compiler converts source code to low-level code
Explanation : Oracle acquired Sun (3) Compilers work fast
year 2010. Microsystems in the
4All the above
Q.9. What was the reason for Ans. (4) All the above
Java? huge initial
g e nitial
succes
success of Explanation: So a compiler is preferred to
www (World Wide Web) EXpa an Interpreter.
(3)
Smart Home (2) Smart TV Q.15.What is the file name extension of a Java source
Ans. (1) www worldAutomation
Wide Web)
(4) None of theEvolution program?
above
Explanation
INTERNET.
: World
Wide Web is (1)
Ans. (3) java
(2) ja Y java (4) jax
also known as
the
Q.10.What is the advantage of Q.16.Choose a correct statement about Java source files.
(1) Run Faster EXE files? Java files are human readable
(1)
(2) Efficient (2) Java files contain Classes with Methods and
(3) No separate Variables
4All the aboveprogram required to run (3) Import statements import library Classes into our
Ans.(4) All the above class
Q.11.Computer Viruses and
4 A l the above
Ans. (4) All the above
transmitted along with which Trojans
(1) JPG files file are often Compilation
Q.17.What is the output of(2)
of Java Program?
(2) TXT files
3EXE files
Ans. (3) EXE (4) ICO files AY .class file cla file
(4) javax file
files je file
(3)
class file
Ans. (1)
KPH MCQIfor BCA Programming
and Dynamic Web Page Design
va
Java
[B.5]
of?
8.41
code is the
result
Q . 2 4
What is
. W
Portability offered by Java language?
Q.18.Byte
HCompiling
a
Java file
(1) Small code size easy to carry occupying less disk
Class file
a space
Compiling
Java File
(2) Interpreting
a
file (2) Generating suitable Byte Code for each machine by
(3) Interpreting
a
Class
the Compiler
(4) java file (
(1)
Compiling
a
Program?
Ability to
run the Byte on different
mchines
Ans.
compiles a
Java producing the same behaviour and output
software
Q.19.What Runtime
Environment)
(4) Java does not actually provide portability
JRE (Java
(1) Developer Kit) Ans. (3) Ability to run the Byte on different machines
2 J D K (Java producing the same behaviour and output
Virtual Machine)
JVM (Java
(3) Command Prompt
(4) Kit) Q.25.What is JIT in Java?
(Java Developer (1) Java In Timer (2) Java In Time Thread
Ans. (2)JDK Java program on a computasa
software runs a 3 J u s t In Time Compiler (4) Just In Time Runnable
Q.20.What
J R E (Java
Runtime Environment)
Ans. (3) Just In Time Compiler
JDK (Java Developer Kit)
(2) Q.26.Choose the correct statement about Java?
Command Prompt
(3) (1) JIT Compiler produces Byte Code from Java file.
above
(4) None of theRuntime Environment)
Ans. (1)JRE (Java JIT Compiler takes
chunks of Byte Code as input and
produces Executable code on that partieular machine.
stands for?
Q.21.What does JVM (3) JIT Compiler assists the actual JAVAC compiler to
(1)Java Variable Machine compile fast
Java Virtual Machine
(4) None of the above
(3) Java Virtual Mechanism Ans. (2) JIT Compiler takes chunks of Byte Code as input and
(4) None of the above produces Executable code on that particular machine.
Ans. (2) Java Virtual Machine
Explanation: JRE Software creates JVM in the PC. JVM 9.27.What happens in the absence of JIT Compiles in
is implemented differently on different machines and Java?
hardware so that the Byte Code present in the Class filk (1) Byte code is produced slowly
produces the same output. 2Executable Code is produced slowly because of line by
line Interpreting
Q.22.What is JVM1?
(1) JVM is the confined memory area
(3) Executable Code is produced without portability
(2) All java p rograms run inside JVM memory 4) None of the above
Ans.(2) Executable Code is produced slowly because of line by
(8)JVM provides security to the computer by
giv line Interpreting
controlled access to Files and Memory on a computer
4All the above Q.28.What are the main Distribution types of Java
Ans.(4) All the above Software?
Q.23.When was first Java SE (Java Standard Edition)
released? Version of Java i.e. Java Lo wa
(2) Java EE (Java Enterprise Edition)
(1) 1991 (2) (3) Java ME (Java Micro Edition)
1994
Ans. (3) 1996 31996 (4) 1999 4All the above
Ans. (4) All the above
ming and Dynamic Web Page Design
KPH MCO for BCA
r o g r a m m i n g
J a v a
with Java Version edit java programs. It does notlike Notepad to type or
Q.30.What is LTS mentioned along Running java programs withouthave ability
n a m e s like Java SE 11 LTs?
or
Compiling
LTS stands for Long Term Support
Java Packages on the PC. installing separate
(1)
LTS Versions are patched for security vulnerabilities
(2) Java editor is like Eclipse IDE that
(2) options or buttons to compile and has shortcut
for up to 5 Years from the release date. run
java programs
without using CMD or Command Line.
(3) Java SE 8 LTS (supported up to March 2022) and
(3) Java IDE searches for the
Java SE 11 LTS (supported up to September 2023) installed
JAVAC, JAVA and JAWAH to Java location for
are available as of now.
programs for you. compile and run
4All the above 4All the above
Ans. (4) All the above
Ans.(4) All the above
Q.31.What is Ahead of Time Compiler in Java? Q.35.Every statement in Java
(1) Ahead of time compiler compiles java files as and
a?
language should end with
when you type and save.
(1) Dot or Period (2) Comma
(2) Ahead of time compiler turns byte code to executable
code line by line based on requirement 3Semicolon (4) Colon
Ans. (3) Semicolon
(3Ahead of time compiler is a replacement for JIT
compiler to translate all byte code to a single Q.36.A function in C language is similar to what in Java
executable file or code to run the program fast and language?
efficient. ( Method (2) Member
(4) None of the above (3) Variable (4) None of the above
Ans.(3) Ahead of time compiler is a replacement for JIT Ans.(1) Method
compiler totranslate all byte code to a
single 37.All methods and variables in Java
executable file or code to run the language are kept
program fast ana inside a?
efficient.
(1) File 2Class or Interface
Q.32.What is the Java command used to (3)
compile jav Ans.(2) static method (4)
a main
program from Command Line Class or
or Interface
Interface
or CMD?
or Command Promp"
(1) OWhat is the need to mention "static" before main
java hello.java
(3) javacomp hello,java 2javac hello.java
(4)>javacmd
method?
T o call main method without creating an objoct of
Ans. (2) javac hello.java hello.java
class
Programming and DynamiC Web Page Design
KPH MCQ for BCA Java
[B.8
class method common to
[B.9)
(2) To make main method as all (1) Passing arguments at compile time
instances 2 Passing arguments at run time
8Both A and B (3) Counting number of words
None of the above
(4) (4) Nothing
Ans. (3) Both A and B
Ans. (2) Passing arguments at run time
Q.39.In standalone Java applications, which method Explanation: C:>java Hello AFRICA GOLDMINE
mandatory? Hello Class name
main method (2) show method AFICA First argument
(3) display method (4) print method
GOLDMINE Second argument
-
main method
Ans. (1) 4 What is the default return type of a method
Explanation: main) is the starting point of execution. language? in Java
Q.40.What is the use of Access modifier "pubie" in Java (1) void (2) int
language? short
(3) 4None of the above
(1) To hide the main method from misuse Ans. (4) None of the above
(2To call the main method outside of Class or Package Explanation: You have to explieitly mention a returnn
by JVM type.
(3) To protect main method
(4) None of the above Q45.Name of a Class, Variable, Method or an Interface in
Java language is called?
Ans. (2) To call the main method outside of Class or Package
by JVM
(1) Argument (2) Value
Q.41.Choose a Single Line Comment in Java Language (3Identifier (4) None of the above
Ans. (3) Identifier
below?
( /Some comments 2) Some comments// Q.46.A valid identifier in Java language may contain
(3) *Some comments*/ (4) */Some comments/* which characters?
Ans. (1) /Some comments (1) 0-9 (2) A-Z, a-z
Q.42.Choose a multiline comment in Java
(3 S,Underscore) Althe above
language Ans. (4) All the above.
below?
(Y Pcomments are going Q.47.A valid Identifier or name in Java language can
cars are moving*/
(1) *Icomments are going
start with which character?
(1) a-z, A-Z (2)
cars are moving/* (3) 0-9 4 A and B
(2) Icomments are going Ans.(4) A and B underscore
cars are moving//
Explanation : Up to JDK 8, only a single
(3) None of the above symbol can be used as an identifier of a class,
method or a
Ans. (1) comments are going variable. JDK 9 does not allow.
cars are moving"/
available in Java
48.What are the valid White Spaces
Q.43.String args[] in main
public statie void
method are used for? language
(1) Space (2) Enter
main(String args|) 4 A l l the above
(3) Tab
Ans.(4) All the above
[B.10]
KPH MCQ for BCA Programming and Dynamic Web Page Design
Java
0 to 9 and
44 All the above
Ato Fla to f equired to use
Comparison
4
Ans. (4) (3) 3 (4)
All the above (1)1 ,(2)2
Ans. (2) 2
KPH MCO for BCA
B.16) the left J a v a
Programming and Dynamic Web Page Design
one o n
//Two operators
Explanation:
lone on the right. Q.88. IF-ELSE statement is also B.17
if(a = b) (1) Branching statement called
(2) Control statement
Q.82.What are the types of
data that c a n be used al.
long (3) Block statements
Java?
operators in A4All1
with Relational
Ans.(4) All
(1) char, boolean, Object
byte, short, int, long Explanation: 3lock
(2)
nded by Bracesand statements are
those that are
(3) float, double
(4)All the abovee also called a Block
.
statement.
So, a usually
WHILE statement is
Ans. (4) All the above IF o r ELSE IF
of Java
Q.89.An statement accepts
Q,83.Choose the Conditional operators listed before branching. as input
below. (1boolean
(2) int
(1) (2) , (3) float (4) char
= 4 A l l the above
(3) Ans.(1) boolean
Ans. (4) All the above
Q.84.Which operator group has higher priority between 9.90.An IF statement in Java is also a
F}?
(1) Boolean
(2conditional statement.
> < , <) and ( (3) iterative (4) optional
(1) P>=, s h a s lower priority (=, != Ans. (2) conditional
(2(>, >5< < has higher priority ( S 9
(3) ,5,5, <has equal priority with ( !=) Q.91.A SWITCH case statement in Java is
(4) None of the above statement.
a
control
Ans. (2) (, =,<, <has higher priority ( , (1) Iteration ( Loop
Q.85.What are the two possible Logical Operator types? 3)Selection (4) Jumnp
Ans. (3) Selection
(1) Bitwise Logical (2) Boolean Logical
(3) Arithmetic Logical ( 4 A and B Q.92.Which is the alter:native to SWITCH in Javi
Ans. (4) A and B language?
Q.86.What is the other name for a Question Mark - Colon (1) break, continue (2) for, while
(2:) operator in Java? (3)if, else (4) goto, exit
(1) Special Relational operator Ans. (3) if, else
(2) Special Logical Operator Explanation: We can implement a SWITCH statement
(3)Ternary Operator using IF, ELSE IF and ELSE control statements.
(4) None
Q93.What are the keywords used
Ans. (3) Ternary Operator
to
implemen
SWITCH case in Java language?
Q.87.Java Ternary operator is sometimes called. (1) switch, case (2) default
(1) Relational Operator (3) break (4) All
(2 Conditional Operator Ans (4)All
(3) Logical Operator
(4) None .94.What are the parts of a SWITCH in java?
Ans. (2) Conditional Operator (1) switch input condition
(2) case constants
avaProgramming
ng and Dynamic web Page
KPH MCQ for BCA Design
[B.18) .101.In
Java language, an array index 8.19
(3) case s t a t e m e n t s (1)
1
0 (3) 1 4) starts with
Ans.( 2 )
0 Any integer
J4All
Ans. (4) All Which are the special symbols
programming language? array in Java? used to
Q.95.What is a Loop in Java declare an
( ALoop is a block of code that is executed atedly (1) Braces {} (2) Parentheses 0
condition is satisfied. (Square Brackets [] (4) Angled
ngled Brackets
as long as a
block of code that is executed only once if Ans. (3) Square Brackets []
ns.(3) Bracke <>
(2) A Loop is a
the condition is satisfied. Which the
A Loop is a block of code that is executed more than2 special symbols used to
are
he time of the
declaration itself?initialize an
at
(3) array
times if the condition is satisfied. (1) Parentheses ()
(2) Square Brackets []
(4) None (3Braces {} (4)
Ans. (1) A Loop is a block of code that is executed repeatedly Ans.(3)
Ans.(3)
Braces{} Angled Brackets <>
as long as a condition is satisfied. Explanation: int|| nums {1,3,6); =
(1)
Methods using B.21)
( 3 Multidimensional (4) Multi-value Interfaces Variables in Java.
(3) (4) All the above
Ans. (3) Multidimensional Ans.(2) Variables
of dimension N contains
Q.110.An array
subscripts or brackets?
numberr o g117.A ass in Java is like a
Prototype (2) Instruction Sheet
(1) N-1 ON (3) N+1 (4) 10*N
(3) Blueprint AAll the above
Ans. (2) N Ans.(4) All the above
Explanation : We should not mention the size of any row 1Class (2) Java (3) class (4) java
or column. Ans. (3) class
Q.114.Java is a, programming language. Q.122.A Java class can contain
(1) Functional 1) Variables
(3) Theoretical 20bject-Oriented
(4) All the (2) Methods, Constructors
Ans. (2) Object-Oriented above
(3) Inner Classes (A class inside another class)
Explanation: Everything in Java is 4All the above
Object-Oriented piinciples. implemented usiu Ans. (4) All the above
Q.115.In Java
programming language, the ced How many maximum numbers of objects can be
inside code is
plac Created from a single Class in Java?
(1) Classes, Inter+aces (1) 32 None
(3) Blocks (2) Methods An: (2) 64 (3) 256 4
4All the above Ans.(4) None
Ans.(4) All the above limit the number of objects
planation: There is no on
forrBR
CA a
f31.In i n t oa method.
(4) None
user-defined or built-in. (3) destructor
(1) Class Ans, (2) constructor the
(3) Superclass 20bject
(4) Null successfully
overload a
method in Java,
Same but
using
Q.130.A Java method is
comparable to
8)
a work also
language. in
None or
subclass types
(1) structure (2) (4) but using
superclass
union Same
(3 function Ans. (3)
(4) enum work
Ans. (3) function
[B.24] KPH MCa for BCA ning and
a v aP r o g r a m m i n g a n d
Writing a
overriding in Java?
method in
Q.140.What are the features reused using Inheritance of superclass's method
a
subclass with the
in same name
Java? (9
(1) Methods Variables
Mentioning the same return type of the
(2) superclass method of the
(3) Constants 4 A l l the above (3) The argument ist in the method subclass
Ans. (4) All the above method of superclass should be theofsame and the
Explanation: Variables and Methods are reused through 4All the above
inheritance. Constants are nothing but variables only if Ans. (4) All the above
they hol& some value.
9.146.An abstract class in dava can be created
Q.141.The class that is being inherited or subclassed keyword using the
is
called (1) final (2) interface
(1) Subclass 2Supercless 8 - abstract (4) static
Ans. (2) Superclass Ans. (3) abstract
Explanation: Superclass or Super-Class Q.147.An interface in Java is like a 100%
Q.142.The class that inherits an already defined class is (1abstract class (2) public class
called (3) inner class (4) anonymous class
(1) Subclass Ans. (1) abstrect class
(2) Superclass
Ans Subclass Q.148.What is a package in Java?
Explanation : Subclass
1)AInterfaces,
Package is collection of files of type Java Class,
a
pkg
pkg PACKAGE_NAME;
(1) Javascript (2) CSS B.27)
4) pkg PACKAGE_NAME.*;
3HTML (4) SQL
Ans.(3)
HTML
Ans.(1) package PACKAGE_NAME;
declaration statement planation: Applets are
Explanation: A package
but not with *. uld within an HTML page. designed to be
embedded
end with a package name
to declare a Java packa. hof the following
Q.150.The keyword used Q . 1 5 6 . W h
is
required to
applet? view an
2package (1) JCM (2) JDM GY JVM (4) Java
(1) pkg
(3) pkge (4) None of the above Ans. (3) JVM class
Ans. (2) package AExplanation: A JVM is
required to view an
Explanation: package be ther
JVM can
plug-in
a
of the Web applet. The
separate runtime environment. browser or a
Q.151.What is the maximum number of Java Class
that can be kept inside a single Java Package? iles
(1) 8 (2) 64 (3) 128 4Unlimited
Q157.Which method is automaticallv
browser calls the init method? called after the
Ans.(4) Unlimited start (2) stop (3) destroy
Explanation: There is no limit. A Java package can Ans.(1) start (4) paint
accommodate as many files as the disk can hold.
Explanation: start: This method is automatically called
Q.152.The name of a package is the name of the after the browser calls the init method. It is also
called
Java. n whenever the user returns to the page
applet after having
the containing
(1) folder gone off to other pages.
(2) All parent folders separated by DOT symbols Q.158.Which method is only called when the browser
(3) All parent packages separated by DOT shuts down normally?
4All the above symbols
Ans.
(1) start (2) stop 3
'destroy (4) paint
(4) All the above
Ans.(3) destroy
Q.153.The keyword used to import a
package into Java| Explanation : destroy: This method is only called when
class or Interface is_ the browser shuts down normally. Because
applets are
(import
(3)
(2) download meant to live on an HTML page, you should not normally
use
(4) None of the above leave resources behind after a user leaves the page that
Ans(1 import contains the applet.
Explanation: import Q.159.Which of these operators can be used to get run
Q.154.An applet is a Java class that extends time information about an object?
(1) the?
java.Applet class (2) java class (1) getInfo (2) Info
(3) Applet class
4java.applet.Applet class
Ans.(4) java.applet.Applet class 8instanceof (4) getinfoof
Ans.(3) instanceof
Explanation: An applet is a Java class Xplanation : instanceof can be used to get run time
that extends i"
java.applet.Applet class information about an object
Q155.Applets are designed to be 160.Which method the audio clip to replay
embedded within a causes
continually?
(1) public void play0 public void loop0
[8.28] KPH MCQ for BCA Java
Programming
Dynamic Web Page
(3) public void stop0 (4) None of the above
+ion :
Design
Explanation
AWT stands for
Ans. (2) public void loop0
Explanation: public void loop) : Causes the audio clin +.
it is used by applets to Abstract Window B.29)
interact with
replay continually
to Which the container that th user.
Q.165.Wh: is Toolkit,
ave
Q.161.paint) is an abstract method defined in AWT.
can have
MenuBars.It
can have
ike button, textfield etc.?
contain
other
title bar
and
( TRUE (2) FALSE
(1) Panel components
(3) Can be true or false (4) Can not say
Ans. (1) TRUE (3) Window SFrame
(4)
Explanation: paint) is an abstract method defined in Ans. (2) Frame Container
AWT. ae
which is
Q.166.Which
component in AWT that can
a
(4)
Ans. (3)
Abstract Writing Toolkit Dy creating the object of Frame class (association)
Abstract Window Tooikit By extending Frame class (inheritance)
( True (2) False
Ans. (1) True
KPH MCO for
[B.30 CA J a v a ming and Dynamic Web Page Design
P r o g r a m m i n g
are required
to perform
Q.172.The Following steps
9.172.The Following hat is an event in
(1) Implement the
Listeneretener
interface
intertace and overrideo
overrides
it. 1
Q 1 7
Q.173.In which places put the event handling coda the user and system describes any change
can
by
(1) Same class (2) Other class An event is a clasS used for
Anonymous class 44 All mentioned above events defining object, to create
(3)
Ans. (4) All mentioned above . (1) An event is an object that describes
a source
a state change
Q.174.Which package provides many event classes and
Listener interfaces for event handling? Explanation:
change n
An event is
a source.
an object that describes a state
(1) java.awt (2) java.awt. Graphics
(8 java.awt.event (4) None of the above 0 180.Which of
these methods are used to register
Ans. (3) java.awt.event
keyboard event listener? a
Q.183.Event elass is
java.lang
es? Q.189.50
defined? which JDBC
(1) java.io (2)
4java.util
1) jdbc and javax.jdbe classes are
(3) java.net
rdb and javax.rdb
Ans. (4) java.util (2)
(3) jdbc and java.jdbc.sql
Q.184.Which of these methods
can be used to deter
the type of event? mine 4 s q l and javax.sql
and
IgetlDO (2) getSource0 Ans.(4) sql javax.sql
(3)getEvent0 (4) getEventObject) 90.Thin driver is also known as?
Q190,
28.9M
inserting the
Q.195.Which methods are
652
driver in JDBC?
Exception Handling in Java
(1) getConnection) (2) registerDriver)
4Bothb and c
Excep
<h3>
(2hl> (3) <h5> Javatpoint
-
Q.206.Which of the
making the text
following element
italic in HTML?
nsible fo (4)
<input type = "check"
checkbox
and give the valuein HTML, we have
Ans. (1)
(italic tag) tag in HTML
input> tag
use the <input:
Explanation: The <i>
format.
L isis used t attribute. checkbox to its typeto
display the written text in italic
of the
Q.207.How to insert a n image
in HTML?
2.Which
following list?is used to define
in a drop-down selectiontag
(1) img href "jtp.png" > = options
>
(1) select>
(2) list>
(2) img url =
"jtp.png" (3) <dropdown>
(3) Simg link "jtp.png" />>
=
Ans.(4) Coption>
option>
M img src "jtp.png" />
=
Aas The
Ans. (4) imgsrc= "jtp.png" >
3xplanation:
options in
<option> tag in HTML is used
Explanation: The img tag and the src attribute is used . define a
opdown list within <select> to
Ans.(3) Smarquee bgcolor = "red"> Explanation : All HTML tags must be enclosed within
angular<> brackets.
Explanation : The bgcolor attribute is used to set the
background color of an HTML element. 0.214.Which of the following tag is used to add rows in
the table?
Q.209.<input> is: (1) <td> and </td> (2) th> and </th>
(1) a format tag. (2an empty tag
(3) All of the above (3) <tr> and </tr> 4) None of the above
(4) None of the above Ans. (3) <tr> and </tr>
Ans. (2) an empty tag
Explanation The
Explanation: The <tr> tag in HTML is used to define the
:
<input> tag in HTML is used
to rows in the table. It can consist
represent form one or more <th> head
a
input control in HTML document. cells and <td> data cells to define a single row of HTML
Q.210.Which of the following tag is used to make the | table.
underlined text?
(1) i. 215.The <hr> tag in HTML is used for :
(2) <ul> (3 <u> (4) spre>
Ans. (3) <u> (1) new line (2) vertical ruler
Explanation : The <u> (underline tag) tag in (3) new paragraph 4horizontal ruler
used to HTML is Ans. (4) horizontal ruler
display the underlined
underlined text, but it can text.
be
It rendered as8 a
So Explanation: The <hr> tag is used to specify a
specify ackground
838) used
to specify a we, have to image on entire
Explanation:
element
The id attribute18
of the
HTML document. It alloo unique
allocates the
document,
he <body>
of the HTML
docume
the Dac
background attribute in
id for an
be used the JJavaScript
by the avaSeth
and are the
unique identifierwhichtasks.
can
921.What types of unordered or bulleted
CSS to perform
certain HTML? list in
in
tag is used to d:. (1) disc, square, triangle
Q.217.Which of the following
effect?
HTML
display (2) polygon, tnangle, circle
with scrolling disc, circle, square
the text (2) scroll>
(<marquee>
(4) None of the above (4) All of the above
(3) <div> Ans. (3) disc, circle, square
Ans. (1) <marquee>
<marquee> tag
is a
-standard
non-stana. Ansnlanation: The unordered
bulleted list in HTML is
or
Explanation: The used to display the elements in
used to scroll a text
or
image eitha bulleted format.
a
HTML element that is
there are three types of an Mainly,
unordered list: disc, circle,
In simple words, we can sav tthat and
horizontally or vertically. text in up, down. la
square.
scrolls the image or
it automatically
and right direction.
Which of the following is the
paragraph tag in
HTML?
following HTML tag is the special < pp> (2) <b> (3) <pre> (4) None of the above
Q.218.Which of the >
is generally
Explanation: The <table> tag in HTML, a
(1) Initialization
We can create
used to display data in tabular format. (2)Constructorfunction function
table to display the data in the tabular form using tne (3 Initialization and Constructor
<table> element, with the help of <tr>, <th>,
and <t0| (4) Setup) method
Ans. (3) Initialization and Constructor function
elements.
We cannot declare
constructors for
Explanation cannot enforce this
Q.220.Hoy to insert a background image in HTML? nterface in Java. This
m e a n s we
implements
Servlet
which
<body background= "img.png> equirement to any class
(2) img background = "img.png"> interface. ServletConfig
object tor
(9session.getAttribute(String name)
(2) session.alterAttribute(String name)
Explanation : Servlets execute within
of a web server. Since it is the address
space
(3) session.updateAttribute(String namne) written in java it is
(4) session.setAttribute(String name)
independent. The full functionality is available platform
libraries. through
Ans. (1)
session.getAttribute(String name)
Explanation: session has various methods for use. 9.231.Howis the
dynamic
responses to transform the interception
of requests and
Q.228.Which of the following code retrieves () servlet container
information done?
the request as the body of
(3) servlet context (2) servlet contig
binary data? 4servlet filter
(1) DatalnputStream data = Ans.(4) servlet filter
(2)
DatalnputStream data
new
InputStream) Bxplanation: Servlet has various
response.getInputStream)
=
getInputStream) retrieves is
the request in
abstract class. 9232.What is full form of JSP?
an
Q.229.When destroy0 method ofa filter is binary data. ()Java Service Provider
(2) Java Service Pages
(1The destroy() method is called called? 3)
Java Server Provider
the life cycle of a filter only once at the endo A Java Server
Ans.(4) Java Server Pages
Pages
B.42] KPH MCO
Q.231.Which of the following is true about JSP? for BcA
(i) JSP technology is used to
application.
create
create
(ii) The JSP pages are not easier to
weh
Servlet. maintain
(iiJSP page consists of HTML tags and JSP.
than
(1) 1&2 (2) 1& 3 tags.
(3) 2&3 (4) All of the above
Ans. (2) 1&3
Q.232.Which of the following are the life cycle method
jsp? .