Summat Ive
Summat Ive
Summat Ive
Option 1
Iterator is having previous() method.State TRUE
True or False.
Option 4
Correct
2
session
None
JavaScript
can be
written
inside the
page body
class Super2
{
public void display()
{
System.out.println("super class display
method");
}
public void exe()
{
System.out.println("super class exe
method");
display();
public void display()
{
System.out.println("sub class display
method");
}
public static void main(String [] args)
{
InheritMethod o= new InheritMethod();
o.exe();
}
}
Please select the correct statement with
respect to including Javascript in HTML
pages.
Option 2
FALSE
Option 3
super class
exe method
super class
display
method
super
class exe
method
sub class
display
method
Compilation
error
JavaScript
can be
written
inside the
header
String type
int Type
<jsp:useBean
><jsp:setProp
erty> and
<jsp:getProp
erty>
<jsp:useB <jsp:useBean>
ean>
and<jsp:plugin>
and<jsp:in
clude>
set1 type
GET
REQUEST
Using
User
Controls
error
Private
Public
Assemblie Assemblies
s
Object type 4
<jsp:setProp 1
erty>
<jsp:getProp
erty> and
<jsp:forward
>
PUT
1
Using
3
ASP.NET
web pages
compilation 4
error
Shared
Assemblies
Manoj has created the Hello servlet that <servlet><ser <servlet>< <servlet><servlet- <servlet><se 4
displaya Welcome in the browser window. vletservletname>hello</ser rvletThe code of the servlet is:
name>mywo name>hell vlet-name>
name>hello<
rld
o</servlet- <servlet/servletpackage myworld;
hello</servle name>
class>hello</serv name>
import java.io.IOException;
t-name>
<servlet- let-class>
<servletimport java.io.PrintWriter;
<servletclass>my </servlet><servl class>mywor
import javax.servlet.ServletConfig;
class>hello</ world.hell etld.hello</ser
import javax.servlet.ServletException;
servlet-class> o</servlet- mapping><servle vlet-class>
import javax.servlet.http.HttpServlet;
</servlet><se class>
t</servlet><s
import
rvlet</servlet> name>hello</ser ervletjavax.servlet.http.HttpServletRequest;
mapping><se <servlet- vlet-name> <url- mapping><s
import
rvletmapping> pattern>/hello</ ervletjavax.servlet.http.HttpServletResponse;
name>hello< <servlet- urlname>hello<
/servletname>hell pattern></servle /servletpublic class hello extends HTTPServlet
name> <url- o</servlet- t-mapping>
name> <url{
pattern>/hell name>
pattern>/hel
protected void doGet(HttpServletRequest o</url<urllo</urlrequest, HttpServletResponse response) pattern></se pattern>h
pattern></se
throws ServletException, IOException
rvletello</urlrvlet{
mapping>
pattern><
mapping>
PrintWriter out=response.getWriter();
/servletout.println("<html>");
mapping>
out.println("<head>");
out.println("<title> My Servlet</title>");
out.println("</head>");
out.println("<body>");
out.println("<h>WELCOME</h>");
Which two statements about packages
You achieve A package Packages can be The contents 1,4
are true?
information is loaded nested
of packages
hiding by
into
can be
making
memory
shared by
package
each time
many
constructs
it is
applications
private.
invoked
Which of the following statements is
incorrect about a delegate?
A single
Delegates Delegates are
Delegate is a 4
delegate can can be
type-safe
value type
invoke more shared
wrappers for
than one
function pointers
method
Error
ENAME of
EmpNO
101172
10.9873.765 10.98730.
765
The LOCAL
Specifies
cursor will be that
implicitly
cursor can
deallocated be
when the
available
batch, stored only in the
procedure or batch,
trigger
stored
terminates procedure
or trigger
in which
the cursor
was
created
10.987
The LOCAL
cursor will have
to be explicitly
deallocated
when the batch,
stored
procedure or
trigger
terminates
2
Specifies
that cursor
can be
available to
all local
resources
1,2
TRUE
FALSE
It will
output:
Remaining
Program
Consider you are developing shopping cart Implement None of Implement using
application you have to store details of
using Arrays the listed File APIs
items purchased by the each customer in
options
intermediate memory before storing
purchase details in actual database
permanently note that number of
different items purchased by customer is
not definite it may vary.n How do you
implement given requirement using java
considering best performance of the
application?
Implement
using
Collection
APIs
Instance
1,2,4
members of
a class can
be accessed
only through
an object of
that class
All objects
created from
a class will
occupy equal
number of
bytes in
memory
It will
output:
Bad
Format
Remaining
Program
A class
can
contain
only
instance
data and
instance
member
function
It will ouput:
Index out of
bounds
Remaining
Program
A class is a
blueprint or a
template
according to
which objects
are created
Class name
should be
nouns
Class
Should be simple Class name
name can and descriptive starts with
be java
lower case
vaild
keyword
1,3
<pref.tag1>
<%=result %>
</pref.tag1>
Which of the following are valid for the
<body-content> tag of tag1?
interface B
{
public void bM1();
public void bM2();
}
abstract class A implements B
{
public abstract void aM1();
public abstract void aM2();
public void bM1(){};
}
public class Demo extends A
{
}
In above scenerio class Demo must
override which methods?
Which of the following statements are
correct?
empty
JSP
public void
aM1(){}
All the
listed
options
public void
bM2(){}
public void
aM2(){}
Argument
that uses
param
keyword
must be the
last
argument of
variable
argument list
of a method
Pass by
reference
eliminates
the
overhead
of copying
large data
An argument
passed to the ref
parameter need
not be initialized
Variable
1,2
passed as
out
arguments
need to be
initialized
prior to
being passes
The value
can be the
null
reference
<html> <%!
String
message="he
llo world",
String
getMessage()
{ return
message;} %>
Message for
you:<%!
getMessage()
%> </html>
<html>
<%= String
message=
"hello
world",
String
getMessa
ge(){
return
message;}
%>
Message
for
you:<%=g
etMessag
e() %>
</html>
<html> <%String
message="hello
world", String
getMessage(){
return message;}
%> Message for
you:<%=getMess
age() %> </html>
<html> <%! 4
String
message="h
ello world",
String
getMessage(
){ return
message;}
%> Message
for
you:<%=get
Message()
%> </html>
Triggers
Stored
Procedure
Cursors
response request
session
2,3
PageContext 1
Create stored
procedure
Create
trigger
A sql_variant
cannot
contain a
large varchar
data type
Large varchar
columns are the
only columns
that can be used
as partitioning
key columns
Large
1,4
varchar
columns
cannot be
used as
partioning
key columns
Large
varchar
column
can be
specified
as a key
column in
an index
The code
1
executes
normally but
nothing is
printed
It will
Line 6 is
complie
invalid
successfully
and print 48
Line 5 is
invalid
Line 4 is invalid
By modifying By
By createing
the web
programm security
deployment ing filters constraints
descriptor
By
2
implementin
g the
listeners
Scriplet code
gets no space
in the
generated
scriplet
The init()
method of the
generated
servlet
The doGet() 2
method of
the
generated
servlet
By using the
invalidate()
method
By setting
3
the sessiontimeout
parameter in
the web.xml
file to 1
minute
The
service
method of
the
generated
servlet
Which of the following options can be
By using the By using
used by the controller to destroy a session setMaxInacti the
of a web application immediatly?
veInterval() destroy()
method
method
period to 60
seconds
None
None
It will print
None
ArithmeticEx
ception and
prints 5
Provides a
robust
mechanism
to Data &
Structure
over the web
Compilation
Error
It will print 5
Uses
Enables
proprietar messaging over
y means HTTP
of
describing
data
97
It will give
4
ArithmeticEx
ception
Uses
standard
means of
describing
data
1,3,4
The following
code is an
example of
LINQ query
<a
href='<c:link
value="cogni
zant.jsp"/>'/>
The
following
code
shows the
syntax for
Filtering
data
<a
href='<c:u
rl
value="co
gnizant.jsp
"/>'/>
Using object None
serialization
TRUE
FALSE
The following
code is an
example of
Database query
<a href='<c:link
url="cognizant.js
p"/>'/>
Using object
deserialization
The
1,2,4
following
code shows
the syntax
for Ordering
data
Using Thread 4
Synchronizat
ion
Inheritance
Overriding Encapsulation
Overloading 1
EMMA
Efficient
Reduced
reuse of code network
traffic
JUnit
Efficient
compilation
2,3
Precompiled 1,2,4
execution,
hence faster
containeri sessionid
d
servletid
allowing
all the
users
Open,Fetc
h,Close
Security
Checks
1,4
None of the
listed options
Declare,Open,Fe Open,
3
tch,Close
Declare,Fetc
h,Close
All of the The
Defines an 2
listed
ServletConfig
object to
options
object is
provide
contained within client
the
request
ServletContext information
object
to a servlet
<%@ taglib
prefix="pre"
uri="testuri"
%><html><h
ead> <title>
Demo
</title></hea
d><helloworl
d
attrib="john"
></html>
<%@
taglib
prefix="pr
e"
uri="testu
ri"%><ht
ml><head
> <title>
Demo
</title></
head><pr
e:hellowo
rld
attrib="jo
hn"/></ht
ml>
<%@ taglib
prefix="pre"
uri="testuri"%><
html><head>
<title> Demo
</title></head><
helloworld
"attrib"=john/><
/html>
<xs:complexT
ype
name="Coun
trinfo"><xs:c
hoice><xs:ele
ment
name="count
ryName"
type="xs:stri
ng"/>
<xs:element
name="state
s"
type="xs:inte
ger"/></xs:ch
oice></xs:co
mplexType>
<%@ taglib 2
prefix="pre"
uri="testuri"
%><html><h
ead> <title>
Demo
</title></he
ad><pre:hell
oworld/></h
tml>
<xs:complex 4
Type
name="Coun
trinfo"><xs:s
equence><xs
:element
name="coun
tryName"
type="xs:stri
ng"/>
<xs:element
name="state
s"
type="xs:int
eger"/></xs:
sequence></
xs:complexT
ype>
JDBC is an
API to access
relational
databases,
spreadsheets
and flat files
The
The directive is
directive used to register
is used to a web site
register a
user
control
The directive 2
is used to
register an
application
FALSE
protected abstract
static
Pass by
reference
eliminates
the overhead
of copying
large data
Refractor>
move
method
It will print
the message
"Displaying
message by
using
javaScript"
An
argument
passed to
a ref
parameter
need not
be
initialized
first
Variable passed
as out
arguments need
to be initialized
prior to being
passed
Argument
1,4
that uses
params
keyword
must be the
last
argument of
variable
argument
list of a
method
Refractor> Refractor>
Refractor> 3
Extract
Change Method move
method Signature
It will
display
some
error
message
on
browser
None
#{expr}
</body>
Select one:
What is the syntax of Expression Language ${expr}
in a JSP page?
${"expr"} $[expr]
The
information
is passed
back & forth
through
HTTP
The data
transfer is
XML
based
The
communication
protocol most
often used for
Web Services is
SOAP
The
1,2,3,4
information
is passed
back & forth
through
TCP/IP
Deadlocked
threads
release once
their sleep()
method's
sleep
duration has
expired
If a piece
of code is
capable of
deadlocki
ng, you
cannot
eliminate
the
possibility
of
deadlocki
ng by
inserting
invocation
s of
Thread.yie
ld();
The JVM
implementation
guarantees that
multiple threads
cannot enter
into a
deadlocked state
It is possible 2,4
for more
than two
threads to
deadlock at
once
FALSE
Connector Controller
Model
None
SAX
Use
database
Indexes
XML
Use
Use Views
database
Trigger
Efficient
compilation
import
Reduced
network
traffic
ServletHttpR HttpServle
equest
tRequest
session
language
Precompiled
execution, hence
faster
ServletRequest
Efficient
2,3,4
reuse of
code
HttpRequest 2
Compile
Time
Exception
By overriding
the service
method in
the servlet
class
By
overriding
the destroy
method in
the servlet
class
Attribute is a Which
None
type of tag
represent
s the
content to
be
displayed
in the
page
By
By overriding the
overriding doGet method in
the init
the servlet class
method in
the servlet
class
Provides
4
additional
behaviour to
the tag
header
Session ID
all of the
Improves improves easy
listed options easy
understanding
maintena
nce
A is true, B is Both are Both are false
false
true
Application
ID
Improves
Readability
of the
sofware
A is false, B
is true
Use
Aggregate
function
along with
WHERE
clause in
query to
retrieve
result
Use Aggregate
function along
with GROUP BY
clause in query
to retrieve result
Use
Aggregate
function
along with
ORDER BY
clause in
query to
retrieve
result
The data
transfer is
XML
based
The
communication
protocol most
often used for
Web Services is
SOAP
The
1,2,3,4
information
is passed
back & forth
through
TCP/IP
The
information
is passed
back & forth
through
HTTP
FALSE
isThreadS extends
afe
autoflush
FALSE
TRUE
Debug
Detect compiler
applicatio errors easily
ns issues
easily
None
None
Trouble
2,3,4
Shoot
performance
problems
ResultSet
All of the
listed
options
These are
responsible
for managing
the lifecycle
of servlets,
mapping a
URL to a
particular
servlet and
ensuring that
the URL
requester has
got the
correct
access right
These are
specialize
d web
servers,
which
support
servlet
execution
It will
display
the date
and time
It will display
the current
time as
hh:mm:ss
None
2,3,4
Registering a 2
StyleSheetTh
eme in
web.config
In Java script, for accessing first paragraph document.ge document document.getEle None
tag in the document which of the
tElementsBy .getEleme mentsByTagNam
statement is used?
TagName("p" ntsByTagN e("p"[0])
)[0]
ame("p")
How to divide the page into two rows
when we are using frameset?
What is the correct syntax of the
declaration which defines the XML
version?
Identify the code snippet
DECLARE
var_num1 number:=50;
var_num2 number;
BEGIN
var_num2 :=200;
DECLARE
var_mult number;
var_num1 number:=100; --LINE 1
By using
colspan
By using
rows=50%
,50%
<?xml
<?xml
version="1.0" version="
/>
1.0"?>
Compilation Compilati
Fails
on Fails
due to
error in
line 1
By using
rowspan
None
Runs without
any output
By using
2
cols=50%,50
%
<xml
2
version="1.0
"/>
Compiles,
4
executes and
prints 50
BEGIN
var_mult :=var_num1*var_num2;
END;
dbms_output.put_line(var_num1);
END;
What will be the output of the above code
assume serveroutput is on
Try can be followed with either catch or TRUE
finally.State true or false.
FALSE
The order of
Arguments
passed to
RAISE_APPLI
CATION_ERR
OR is wrong
Replacing
RAISE_AP
PLICATION
_ERROR(20000,'no
negative
age
allowed');
to
RAISE_AP
PLICATION
S_ERROR(20000,"no
negative
age
allowed");
will give
the
desired
output
name
Replacing
RAISE_APPLICATI
ON_ERROR(20000,'no
negative age
allowed'); to
RAISE_APPLICATI
ON_ERROR(20000,"no
negative age
allowed"); will
give the desired
output
http-equiv
No problem 4
in the
trigger. It
gives the
desired
result
value
FALSE
Both are
false
None
Both I & II II
DROP
Cannot
PURGE
DBA_RECYCL drop
RECYCLEBIN
EBIN
tables
from
Recycle
Bin
Which of the following variable represents application exception config
the uncaught throwable object that
resulted from a call to the error page?
Under which two circumstances do you
design database triggers?
To replicate
built-in
constraints in
the Oracle
server such
as primary
key and
foreign key
DROP
3
ALL_TABLE_
RECYCLEBIN
request
To
To duplicate the
guarantee functionality of
that when other triggers
a specific
operation
is
performe
d, related
actions
are
performe
d
For
2,4
centralized,
global
operations
that should
be fired for
the
triggering
statement,
regardless of
which user
or
application
issues the
statement
Refractor> Refractor>
Refractor> 3
move
Change Method Extract
method Signature
method
compareTo
comparator 3
SELECT
Selection,Inte Selection, Intersection,Proj Difference,
e.EMPLOYEE_ID,e.LAST_NAME,e.DEPART rsection, Join Projection ection, Join
Projection
MENT_ID,d.DEPARTMENT_NAME FROM
, Join
Join
EMP e, DEPARTMENT d WHERE
e.DEPARTMENT_ID=d.DEPARTMENT_ID;
6,0
0,5
0,6
compilation 3
error
TRUE
FALSE
<xs:complexT
ype
name:Countr
Info"><xs:seq
uence>
<xs:element
name="count
ryName"
type="xs:stri
ng"/>
<xs:element
name=""stat
es"
type="xs:inte
ger"/>
</xs:sequenc
e></xs:compl
exType>
<xs:compl
exType
name:Cou
ntrInfo"><
xs:choice>
<xs:eleme
nt
name="co
untryNam
e"
type="xs:s
tring"/>
<xs:eleme
nt
name=""st
ates"
type="xs:i
nteger"/>
</xs:choic
e></xs:co
mplexTyp
e>
<xs:complexType None
name:CountrInfo
"><xs:all><xs:ele
ment
name="countryN
ame"
type="xs:string"/
><xs:element
name=""states"
type="xs:integer
"/></xs:all></xs:
complexType>
Prints 14
Prints 6
${initParam["
companyname"]}
TRUE
void
clearAttribut
e(String
name)
void
void
removeAt removeAttribute
tribute(Ob (String name)
ject name)
Prints 0
void
3
flushAttribut
e(String
name)
<%@ page
<form
<jsp:forward
<%@ include 4
import="Hea method=" page="Header.ht file="Header
der.html"%> post"
ml">
.html"%>
action="H
eader.htm
l">
HttpSession 3,4
By using
3,4
rows=50%.5
0%
Result is 10 2
By using
colspan
By using
rowspan
By using
cols=50%.50%
Result is 0 Exception
occurred divide
by zero
A is false, B is
true
Both are
false
document.ge
tElementsBy
TagName("p"
)[0].innertext
()
Which of the following is valid declaration <%@ String
in JSP using declaration tag?
name="Anan
d" %>
None
<%=
public
String
name="An
and";%>
document.getEle
mentsByTagNam
e("p[0]").innerte
xt()
document.g 1
etElementsB
yTagName("
p").innertext
()
<!% String
<%! String
4
name="Rocky"% name="Rock
>
y";%>
Trigger
event
Trigger timing
Trigger body 1
print 034
print 3
Use database
trigger
User cursors 2
TRUE
FALSE
Select
count(*)
from emp
where sal >
(select
avg(sal))
from emp);
Select
count(*)
from emp
where sal
exist
(select
avg(sal))
from
emp);
Session
variables
Select count(*)
from emp where
sal > (select
Average(sal))
from emp);
Select
count(*)
from emp
where sal >
(select
max(sal))
from emp);
Applicatio Cookies
n
variables
Objects
Create
Stored
Procedure
Create
view
Create index 1
Extensible
StyleSheet
Language
Extensible Extensive
Style
StyleSheet
Language Language
None
SAX
doGet
DOM
destroy
None
doFilter
2
4
Create Trigger
XHTML
init
It will give
run time
error
It will
iterate
over the
current
ServletRe
quest
parameter
s and
setting
each
matched
property
to the
value of
matching
parameter
It will iterate
over the current
ServletRequest
parameters and
would not set
any property to
the value of
matching
parameter
It will iterate 2
over the
current
ServletRequ
est
parameters
and getting
each
property to
the value of
matching
parameter
service()
_jspServic
e()
Make
Employee
class
methods
private
jsp_Service()
jspService()
This class
must also
implement
the hashCode
method as
well
The
equals
method
does NOT
proprely
override
the Object
class's
equals
method
Make
Employee
class
methods
public
2
4
Compilation 1
fails because
the private
attribute
p.name
cannot be
accessed
PreparedStat None
ement
CallableStateme Statement
nt
TRUE
FALSE
Undeployme 1
nt
2
TRUE
FALSE
Method
Level
It occurs
during linking
Logical
Structure
It occurs
at runtime
Class Level
Structure
It occurs during
compilation
Physical
1,3,4
Structure
It occurs
2
during JustIn-Time
Compilation
A request
is sent
with HTTP
method
POST
The parameter
username is the
only parameter
passed to the
web server in
the request
The
1,4
parameter
username
and
sbbutton are
passed to
the web
server in the
request URL
Delegates
3
are type-safe
Copy
collections
into other
collections by
calling
addAll()
methods
instead using
iterator to
copy each
collection
element
Use for
loop
instead of
iterator
Use Collections
with generic
with same type
of data
<input>
<h1>
<a>
web.xml
Xmlspy
Xerces
Invalid Variable
declaration
Global
Variable
TRUE
FALSE
JSP
Servlets
JavaScript
VBScript
3,4
HCM
SDLC
SVN
SCM
TRUE
FALSE
Declare the
Programmer
Analyst class
as final
Declare
None of the
the
listed options
Programm
erAnalyst
class as
abstract
Declare the 1
Programmer
Analyst class
as private
init()
contextInitial 4
ized()
Call method
execute() on a
StoredProcedure
Object
Call method 4
execute() on
a
CallableProc
edure Object
Platform
dependent
Call
method
executePr
ocedure()
on a
Statement
Object
Which statement is true about Java server Used to build all of the
pages?
dynamic web listed
pages
options
FALSE
The
The Trigger fires
Trigger
successfully
fails
because a
SELECT
statement
on the
table
being
updated is
not
allowed
The Trigger
fails because
you cannot
use the
minimum
and
maximum
functions in a
BEFORE
UPDATE
trigger
Synchronizat 3
ion
The trigger 3
fails because
it needs to
be a row
level AFTER
UPDATE
trigger
A is false, B is
true
Both are
false
compilation
error
both
both strings are Strings
strings are equal
cannot be
not equal
compared
using ==
operator
Stmt 2 is true
and stmt 1 is
false
Both are
false
none
loading
invoking,
destroy.
user
should
manage
this life
cycle
invoking,destroy,
web browser
manages this life
cycle
Translation 4
&
compilation,
Instantiation
,
initialization,
service
destroy
container
manages this
life cycle
By using
unique
variable
query
contains
error
By using
scriptlet
By using taglib
directive
adds 10
minutes
to the
current
timestam
p
I
adds 10 days to
the current
timestamp
By using
path to the
tag handler
adds 10
seconds to
the current
timestamp
None
TRUE
FALSE
30 minutes
10
minutes
Both I & II
gives
None
illegalStateExcep
tion
TagName
Src
Cntrl
TagPrefix
None