0% found this document useful (0 votes)
2 views

Integra micro Third section(java)

The document is a test paper from Integra Micro Software Services containing multiple-choice questions related to Java programming. It includes instructions for marking answers and specifies the scoring system for correct and incorrect responses. The questions cover various Java concepts, including syntax, data types, and object-oriented programming principles.

Uploaded by

Vpn Account
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Integra micro Third section(java)

The document is a test paper from Integra Micro Software Services containing multiple-choice questions related to Java programming. It includes instructions for marking answers and specifies the scoring system for correct and incorrect responses. The questions cover various Java concepts, including syntax, data types, and object-oriented programming principles.

Uploaded by

Vpn Account
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

oftaare Integra Micro Software Services (P)Ltd.

integra niero
ere9
Version 1.3 21-Dec-2222

Section II Test Code: BJC


Instructions:
sheet provided.
Mark your answers under Section III in the OMR
sheet.
Please write the test code on your answer
Maximum time allotted: 20 minutes
1 mark will be awarded for every correct answer and 025 mark will be deducted For
every Wrong answer.
Use extra sheets for rough work.
Mark your answer by filling in the appropriate bubble as shown below:
a b

Questions:

1. Which of the following answers return true when you replace in the place of
XXXXXXXXX?
public class Test Type {
public static void main(String args[]) {
Button b = new Button ("BUTTON") :
if( XXXXXXXXX) {
System.out .print ("This is an instance of Buton") ;

[a] b instanceof Button


[b] Button
[c] b == Buttoninstanceof b
[d] Button
=(0bject) b
2. What is the
result of
public class Test { compiling the following code?
public static void main ( String [] args) {
int value;
value = value + 1;
) System.out.println(" The value is:" + value):
[a] Compile and runs with no
|b] Compiles and runs output
[c] Does not printing out "The value is 1"
[d] compile
Compiles but generates run time error
3. Which of
[a) goto [b]the fol1lowing are Java
synchronized keywords or
reserved
implements words?
[c] extends [d] [e] A1l of the
4. What is the above
[a] 0 to numeric range for a Java int
(2^32)
[b] - (2^31) to data type?
[c] -(2^31) to (2^31)
[d] - (2^15) to (2^31 - 1)
(2^15 - 1)
. Select all
[a) valid identifiers from the
lhello hello [c] ^hello [d)following?
[b]
b. What is the
#hello [e) none of the
above
[a] package, correct order in list given below?
[b] import, class
class, import, package
[c] import, package, class
[d] package,
class, import
equal WEappers
are "These output No(e)
error, Runtime [b]td] error time Compile (a]
equal") wEappers
aEe (These
System,outprintln
b.equals
(bl)
) LE
(false) : Boolean ew Boolean

(true)1 Bo0lean b new Boolean
equal)s out-println
are ("Both System.
One)a (7est s2new
One) ("Test String StEing StEing
L[1) args(String new String sl
ain void static public
progran? EOllwing MyClass class public
"true followed result
oE the bewi1l What
by equal" 10.
are output No(c]
arroE Runtima th"Bo [(bd]]
error tine Compile [a]
("true): .println System.out
b.equals
(bl)
) 1E
false: boolean
bl
truez booleanb
equal"la are ("Both printin System.
strl.equals( out
One): str2)
("Test String) nex ( 1f
One: str2
- String
args[l) (String Test strl String
main void static Public
progran? folloing MyClass class Public
result
of the bewill What 9
600 isvalue xThe (d] 400 value
is
30. value
s xThe (b] Thex [e]
20 value
is xThe [a]
y y xAnt
y)l (intmethod vOLd
x)1 is
value ("The
.printin
x Systen,out
ta.method
(x#)
()E ytest ne ta
Mytest
201 xint
main(String
[]
)args void static public
30: xLnt
MyTest class public
oode?following the rosult
of the isWhat 8.
pinted screan the printed
on is
World Hello Ls sofvalue The d]
output
is No[e) error time Compile (a]
error Runtime [b]
Ls value
of (The out-print
ln System.
6)1 length()
> s. null)
&& (isl 1f
Strings-Hello
World":
L1) in(String
args sa
void static ic
publ
TestBitL class public
answers? of1ist the Eora answer correct the Select 7.
Serv ohwar Micro integra
signature different
signature different and name method same
and name method the have methodsOverloaded
signature and name nethod same the have thods Overridden [d]
signature same me
the have methods Overloaded [c]
and name method same [b]
the have methods Overridden
true? statements
are [a]
the Which
of 17.
Employee Person
Employee extends class public [d]
Employee extendsextends PersonPerson transient
Employee extends class native [c]
Person class private [b]
legal, are Person class class? existing [a]
level declarations
top is
followinganEmployee assuming
arrayName.size; [d]of the ofWhich 16.
length
i()arrayName. [b]
arrayName.size() ;
array? an length length;arrayName. [c]
of the find toused following (al
is the Which
of 15.
efined. are they where methods modifier
for
nethod. class implementation
the in a istati valid (d]s
main
() from called nohave thods Abstractme
bemodifier
can access (c]
method? defining with Methods
no (b]
about true modifier.
statements valid Transient
a is
are following (a]
the of ch
Whi I4.
execution");) ("Statig above the ofAll Ie)
print out. tem. Sys tic( ta s[d]
35; t= protected
int [a]
=5.Od; doubled transient (b]
""; =String
s priva
te [a)
valid? declarations
are ollowing the ofWhich 13.
this
;() [d] super
i() [c] (100) ; this [b] (100); super [a]
B()7 new Bb
])args(String main void static publiC
{B)
Bextends
( A class public
{} i)
A(int
class
A
line//xxxxx?
comment the replace
at answer
to correct the select code, piece
of the Given 12.
error time Run Ld]
Constructor error time Compile [al
Construtor Class
A followed
by Construator Class
B
Class
B followed
by Constructor [b]
Class
A [a)
B() new Bb=
))args (String main void static publiC
Constructor")i ("Class
out.println
B System,
extends
( A class
B publiG
Constructor")7 ("ClassA out.print
ln System,
code?following texecute
he classA
you when printed bewill What
Ltd. Services
(P) Software Micro Integra 11.
printed is 100 Only [d] printed
100,200,300 values The
printed Nothing [e]
error time Compile [b] is [a]
break;
out.print
(i) ; ln System.
300: Case
break;
out.println(i) ; System.
200: Case
break;
.println
(i) ; System.
out
100: case
{(i) switch
100; = i int
code?
following the run andcompile you when result the is What 21.
1ls: j value
of The 1; is: i of
value The [e]
is:0 j value
of The 1; is: i value
of The Ld]
2is: value
j of The 0; is: i of
value The [c]
1is: j of
value The 0; is: i value
of The (b]
0is: value
j of The 0; is: i value
of The [a]
j): "+ is: i of
value ("The
.println out System.
): i t "is: i ofvalue out.println
("The System.
outer; Continue
*j) i ( if
jt+) 3; < j 0; = j int (for
( it+) i
2; < i 0; = (int for outer:
program the output
of the is What 20.
run? compile
and you if following
abstract, defined
as cannot
be Methods [e]
t. variables
be can only
Test
;() voidabstract final [d]
:Test
() void
abstract static [c]
()
0 Test voidabstract [b]
Test
;() voidabstract [a]
following the Whi
of ch 19.
define toways valid are
ethod. abstract an
printed Fourth
is [e]
printed is
Third [d]
printed Second
is [c)
printed is
First (b)
printed Nothing
is [a]
System.
out
("Eourth"): .printin
else(
("Third"):
System.out,print
ln
>,5) (e ifelse
ln("Second")
Systen.out.print
:
else
Systen.out
.print
("Erist
"): ln
b6, e 0, aint 18.
10:
result the i8Nhat
compile you when
following the run and
code?
method start
() completing
the after dies 1nread
nethod. ()
run [a]
run eligible inlies body Thread [c]
to makes
it method start
() Thread [D]
extet interface
or Runnable inplements either Thread,
true? statements new create Class
a 10 ba)
are following the Wnich
of 25.
PointerException:
demo lang.Null java.Recaught:
followed
by demoMethod. inside Caught
printed. thing
issuccessfully, d]
no Compile [c]
error Runtime [b]
error
Compilation [a]
("Recaught:
e); +"
PointerException out.print
ln System.
{ e) catch
demoMethod()(Null
; }
{[|) args(String in ma
void static public try
exception re-thrOw
the
demoMethod.
")
: inside ("Caught
out.printIn // chrow
interException System., e
("demo") : Exception e) Pointer (Null
Po catch
Null new throw
(try
thod
()demoMe void static
run? andcompile ThrowDemo( class public
you when following
code the result
of the isWhat 24.
Thread running currently above the ofAll [e)
the kills thod me () stop (d]
A
again. started becanThread dead La]
returns A
method ()run the after dies Thread
run. eligible
to 1t
makes nethod b]
start) Thread a)
true? statements
are following the af ch Wi 23.
the
natifyAll()above and stap)ofAll [Lad]l
destroy() and 0zua [cl
resume() and st)ag 2]
notify() and wait() [al
threadcontrolling for used best cmicaticn?
are pairs nathod follawing the Which
af 22.
LAd Senices
(P) Sotware Micro Integra

You might also like