Sei sulla pagina 1di 8

What is

true about
thread

Thread is a
ligthweight
Process

What is the
difference
between
yield and
sleep
Which two
of the
following
methods
are defined
in class
Thread
start()
Select
state of the
Thread
New
Select
what is
true about
ExecutorS
ervice
Select the
type of
thread
pools that
can be
created
using
Executors
class
Select the
methods
provided
by the
ExecutorS
ervice
What is
true about
shutdown()
method

Threads shares
heap memory of
the Process
sleep changes the
state of the thread
from Running to
Waiting whereas
yield changes the
state of the thread
for Running to
Runnable

A Thread
maintains its
own stack
thread.sleep(1
000) will sleep
for 1 sec
whereas with
yield there is
no such
guarantee

run()

It is used to
create, invoke
and schedule
Asynchronous
threads

It is used to
create and
manage Thread
pool

Running
It is used to
submit a
thread that
can be
completed in
future

Executors.newSi
ngleThreadExec
utor

Executors.newCa
chedThreadPool

Executors.ne
wFixedThread
Pool

execute(Runnabl
e)
when shutdown
method of the
executorservice
is called it will no

both are static


methods
defined in the
Thread class

Runnable

submit(Runna
ble)
executorSeriv
e.shutdown()
waits till all the
submitted

Dead

invokeAny()
executorSeriv
e.shutdown()
is used for
graceful

ExecutorS
ervice
Select the
component
s of JDBC

more take any


new task
DriverManager

tasks are
completed
Statement

Statement has to
be compiled
Difference everytime
between
whereas
Statement PreparedStatem
and
ent are
PreparedSt precompiled
atement
cached
What is
true about
ResultSet
interface
Select the
ResultSet
types in
JDBC
Select the
JDBC
driver
types
How the
connection
object is
obtained in
JDBC
JDBCODBC
Bridge
support
multiple
concurrent
open
statements
per
connection
? True or
False

ResultSet
returns one or
more rows from
the database
table
TYPE_FORWAR
D_ONLY
Type 1: JDBCODBC driver

shutdown of
the service

Connection
Statement is
suitable for
DDL
Operations,
PreparedState
ment is
suitable for
DML
Operations
When
ResultSet is
returned, it is
positioned
before first
row
TYPE_SCRO
LL_SENSITIV
E

TYPE_SCRO
LL_INSENSIT
IVE

Type4: JDBC
Type 2: NativeType3: JDBC
pure java
API driver
net driver
driver
getConnectio
n(String url,
getConnection String
(String url,
username,
getConnection(Str Properties
String
ing url)
prop)
password)

FALSE

Select
Junit Test
classes
What
methods
can be
tested
using Junit
Select the
Junit
assert
statements
Select
what is
true about
Junit Test
case
Select the
correct
statement
Select the
utility Java
provides to
implement
L18N and
L10N
What
Localizatio
n relates to
Select the
type of
java.util.Re
sourceBun
dle
provided
by java
Select the
methods of
java.util.Lo
cale
Select the
Locale
constants

Assert

TestCase

TestResult

TestSuit

Default

If Junit Test method is


declared to return a
String it will compile
without any issue

Public
assertFalse(S
tring
message,
boolean
condition)
All the Test
cases
methods
should be
declared void
You can also
pass
parameter to
a Junit Test
method

Use of Currency

java.util.resou
rcebundle
Symbols,
icons and
colors

assertEquals(Str
ing message,
String expected,
String actual)
Junit test case
extends
junit.framework.
TestCase

All the Test


methods are
annotated with
@Test

assertTrue(Str
ing message,
boolean
condition)
All the Test
cases
methods run
independent
of each other

java.util.locale
Numeric, date
and time formats

Keyboard
usage

PropertyResource
Bundle
getAvailableLoc
ales()

getDisplayLangua
ge()

Locale.CANADA

Locale.CANADA_
FRENCH

ListResource
Bundle

getLanguage()
Locale.ITALY

Which of
the
following
allows non
repeatable
read in
JDBC
Connection
Which type
of driver
provides
JDBC
access via
one or
more
ODBC
drivers?
Type 1
When the
message
No
Suitable
Driver
occurs?
What is, in
terms of
JDBC, a
DataSourc
e?
Which
method is
static and
synchroniz
ed in JDBC
API?
getConnection()
Which two
of the
following
methods
are defined
in class
Thread?
start()
Which
three
guarantee
that a
thread will

TRANSACTION_
REPEATABLE_R
EAD

When the JDBC


database URL
passed is not
constructed
properly
A DataSource is a
factory of
connections to a
physical data
source

run()
wait()

sleep(1000)

aLiveThread.j
oin()

leave the
running
state?
Which of
these
method is
used to
find out
that a
thread is
still running
or not?
What is the
default
value of
priority
variable
MIN_PRIO
RITY AND
MAX_PRI
ORITY
Which of
these
method is
used to
explicitly
set the
priority of a
thread
How To
Compile a
JUnit Test
Class?
javac
What
Happens If
a JUnit
Test
Method Is
Declared
as
"private"?
What
should be
the return
type of a
testMethod

Alive()

1 & 10

setPriority()

Runtime error
void

in Junit
What
Happens If
a Test
Method
Throws an
Exception
Queue can be used to
implement
A binary search tree whose left
subtree and right subtree differ
in hight by at most 1 unit is
called
.. in which the
model becomes compatible
executable code
Stack is also called as
Which of the following is true
about the characteristics of
abstract data types?
(i) It exports a type. ii) It
exports a set of operations

Runtime test fails


quick
sort

radix sort

AVL
tree
Implementation
level
Last in
first
out

True, True
None
of the
above
None
of the
above

is not the
component of data structure.
Which of the following is not
the part of ADT description?
Inserting an item into the stack
when stack is not full is called
. Operation and
deletion of item form the stack,
when stack is not empty is
called ..operation.
. Is a pile in which
items are added at one end
and removed from the other.
is very useful in
situation when data have to
stored and then retrieved in
reverse order.

Compilation
Succeeds

push,
pop
Queue

Stack

A directed graph is
. if there is a path
from each vertex to every other
vertex in the digraph.
In the .. traversal
we process all of a vertexs
descendents before we move
to an adjacent vertex.
Identify the acceptable
properties of Graph
i) Network is a graph that has
weights or costs associated
with it.
ii) An undirected graph which
contains no cycles is called a
forest.
iii) A graph is said to be
complete if there is no edge
between every pair of vertices.
The number of comparisons
done by sequential search is

In , search start at
the beginning of the list and
check every element in the list.
State True or False. i) Binary
search is used for searching in
a sorted array. ii) The time
complexity of binary search is
O(logn).
Which of the following is not
the internal sort?
State True or False. i) An
undirected graph which
contains no cycles is called
forest. ii) A graph is said to be
complete if there is an edge
between every pair of vertices.
A graph is said to be
if the vertices
can be split into two sets V1
and V2 such there are no
edges between two vertices of
V1 or two vertices of V2.
In a queue, the initial values of
front pointer f rare pointer r

Strongly
Connected
Depth
First

True, True,
False
(N+1)/2
Linear
search

True,
True
Merge Sort

True,
True

Bipartite
0 and -1

should be .. and ..
respectively.
In a circular queue the value of
r will be ..

r=(r+1)%
QUEUE_SIZE

Potrebbero piacerti anche