0% found this document useful (0 votes)
7 views8 pages

Java Programming Language Quiz Questions

The document consists of a series of multiple-choice questions related to Java programming concepts. Each question presents a topic such as Java language history, control statements, data types, and object-oriented programming principles, followed by four answer options. The correct answers are indicated for each question.

Uploaded by

5mrhmhw7vw
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views8 pages

Java Programming Language Quiz Questions

The document consists of a series of multiple-choice questions related to Java programming concepts. Each question presents a topic such as Java language history, control statements, data types, and object-oriented programming principles, followed by four answer options. The correct answers are indicated for each question.

Uploaded by

5mrhmhw7vw
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1.

i
sknownasf
atherofJav
aPr
ogr
ammi
ngLanguage?

A.
JamesGosl
i
ng

B.
[Link]
a

C.
Char
elBabbage

D.
Blai
sPascal

Answer:[
A]

2.

I
njav
acont
rol
stat
ement
sbr
eak,
cont
inue,
ret
urn,
try
-cat
ch-
fi
nal
l
yandasser
tbel
ongst
o?

A.
Sel
ect
ionst
atement
s

B.
LoopSt
atement
s

C.
Transf
erst
atement
s

D.
PauseSt
atement

Answer:
[C]

3.

Whi
chpr
ovi
desr
unt
imeenv
ironmentf
orj
avaby
tecodet
obeexecut
ed?

A.
JDK

B.
JVM

C.
JRE

D.
JAVAC

Answer:
[B]

4.
Whati
sby
tecodei
nJav
a?

A.
Codegener
atedbyaJav
acompi
l
er

B.
Codegener
atedbyaJav
aVi
rt
ual
Machi
ne

C.
NameofJav
asour
cecodef
il
e

D.
Blockofcodewr
it
teni
nsi
deacl
ass

Answer:
[A]

5.

Whi
choft
hef
oll
owi
ngar
enotJav
akey
wor
ds?

A.
doubl
e

B.
swi
tch

C.
then

D.
inst
anceof

Answer:
[C]

6.

Whi
choft
hesehav
ehi
ghestpr
ecedence?

A.
()

B.
++

C.
*

D.
>>

Answer:
[A]

7.

Whi
choft
hesei
sret
urnedbyoper
ator'
&'?
A.
Int
eger

B.
Char
act
er

C.
Bool
ean

D.
Float

Answer:
[B]

8.

Dat
aty
pel
ongl
i
ter
alsar
eappendedby_
___
_

A.
Upper
caseL

B.
Lower
caseL

C.
Long

D.
Bot
hAandB

Answer:
[D]

9.

Whichvar
iabl
esarecr
eatedwhenanobj
ecti
scr
eat
edwi
tht
heuseoft
hekey
wor
d'new'
and
dest
roy
edwhent heobj
ectisdest
roy
ed?

A.
Local
var
iabl
es

B.
Inst
ancev
ari
abl
es

C.
ClassVar
iabl
esD.
Stat
icv
ari
abl
es

Answer:[B]

10.

Jav
alanguagewasi
nit
ial
l
ycal
l
edas_
___
___
_
A.
Sumat
ra

B.
J++

C.
Oak

D.
Pine

Answer:
[C]

11.

Whati
sgar
bagecol
l
ect
ioni
nthecont
extofJav
a?

A.
Jav
adel
etesal
lunusedj
avaf
il
esont
hesy
stem.

B.
Memor
yusedbyt
heobj
ectwi
thnor
efer
encei
saut
omat
ical
l
yrecl
aimed.

C.
TheJVM cl
eansout
putofJav
apr
ogr
am wi
ther
ror
.

D.
Anyunusedpackagei
napr
ogr
am aut
omat
ical
l
yget
sdel
eted.

Answer:
[B]

12.

Whi
chonei
sat
empl
atef
orcr
eat
ingdi
ff
erentobj
ect
s?

A.
AnAr
ray

B.
Acl
ass

C.
Int
erf
ace

D.
Met
hod

Answer:
Acl
ass[
Opt
ion:
B]

13.

Whi
chsy
mbol
isusedt
ocont
aint
hev
aluesofaut
omat
ical
l
yini
ti
ali
zedar
ray
s?
A.
Bracket
s

B.
Braces

C.
Par
ent
heses

D.
Comma

Answer:
Braces[
Opt
ion:
B]

14.

Whi
chonei
str
ueaboutaconst
ruct
or?

A.
Aconst
ruct
ormusthav
ethesamenameast
hecl
assi
tisdecl
aredwi
thi
n.

B.
Aconst
ruct
ori
susedt
ocr
eat
eobj
ect
s.

C.
Aconst
ruct
ormaybedecl
aredpr
ivat
e

D.
All
oft
heabov
e

Answer:
All
oft
heabov
e[Opt
ion:
D]

15.

Whi
choft
heseoper
ator
sisusedt
oal
l
ocat
ememor
ytoar
rayv
ari
abl
einJav
a?

A.
all
oc

B.
mal
l
oc

C.
newmal
l
oc

D.
new

Answer:
new[
Opt
ion:
D]

16.

Whi
choft
hesei
snotabi
twi
seoper
ator
?

A.
&'Oper
ator
B.
&='
Oper
ator

C.
|='
Oper
ator

D.
<='
Oper
ator

Answer:
<='
Oper
ator[
Opt
ion:
D]

17.

Whi
choft
hesei
sret
urnedbyGr
eat
erThan,
LessThanandEqual
To(
i.
eRel
ati
onal
)oper
ator?

A.
Fload

B.
Int
eger

C.
Bool
ean

D.
Doubl
e

Answer:
Bool
ean[
Opt
ion:
C]

18.

Whichst
atementt
ransf
erexecut
iont
odi
ff
erentpar
tsofy
ourcodebasedont
hev
alueofan
expr
essi
on?

A.
If

B.
Swi
tch

C.
Nest
ed-
if

D.
if
-el
se-
if

Answer:
Swi
tch[
Opt
ion:
B]

19.

Modul
usoper
ator(
%)canbeappl
i
edt
owhi
choft
hese?

A.
Int
eger
s

B.
Float
ing-poi
ntnumber
s
C.
Bot
hAandB

D.
NoneofThese

Answer:
Bot
hAandB[
Opt
ion:
C]

20.

Whatf
eat
ureofOOPhasasuper
-cl
asssub-
classconcept
?

A.
Hier
archi
cal
inher
it
ance

B.
Singl
einher
it
ance

C.
Mul
ti
plei
nher
it
ances

D.
Mul
ti
lev
eli
nher
it
ance

Answer:
Hier
archi
cal
inher
it
ance[
Opt
ion:
A]

21.

Whi
choft
hef
oll
owi
ngar
enott
hemet
hodsoft
heThr
eadcl
ass?

A.
yi
eld(
)

B.
sleep(
longmsec)

C.
go(
)

D.
stop(
)

Answer:
go(
)[Opt
ion:
C]

22.

Di
vi
sionoper
atorhas_
___pr
ecedenceov
ermul
ti
pli
cat
ionoper
ator

A.
Hei
ghest

B.
Least
C.
Equa

l
[Link]

Answer:
Equal
[Opt
ion:
C]

23.

Whati
sthef
ull
for
m ofJVM ?

A.
Jav
aVer
yLar
geMachi
ne

B.
Jav
aVer
if
iedMachi
ne

C.
Jav
aVer
ySmal
lMachi
ne

D.
Jav
aVi
rt
ual
Machi
ne

Answer:
Jav
aVi
rt
ual
Machi
ne[
Opt
ion:
D]

24.

I
nJav
acode,
thel
i
net
hatbegi
nswi
th/
*andendswi
th*
/isknownas?

A.
Mul
ti
li
necomment
[Link]
ngl
eli
necomment

C.
Bot
hA&BD.
Noneoft
hese

Answer:
Mul
ti
li
necomment[
Opt
ion:
A]

25.

Whi
choft
hef
oll
owi
ngar
enotJav
amodi
fi
ers?

A.
publ
i
c

B.
pri
vat
e

C.
fr
iendl
y

D.
tr
ansi
ent

Answer:
fri
endl
y[Opt
ion:
C]

You might also like