Programming - Methods in Java
You Are Here :: Home > JAVA > Methods in Java - General Questions
19. |
A class variable is a variable whose single copy in memory is shared by ___________ objects.
|
A. |
one |
B.
|
two or more |
C.
|
all
|
D.
|
none
|
|
Answer: Option C
Explanation:
A class variable is a variable whose single copy in memory is shared by all objects. |
|
20. |
Is Instance variables are not available to static methods or not?
|
A. |
Yes |
B.
|
No |
C.
|
cant say
|
D.
|
May be
|
|
Answer: Option A
Explanation:
After executing static methods,JVM creates the objects. |
|
21. |
A ____________ block is a block of statements declared as Static.
|
A. |
Instance |
B.
|
abstract |
C.
|
Static
|
D.
|
Non Static
|
|
Answer: Option C
Explanation:
A Static block is a block of statements declared as Static. |
|
22. |
Is it possible to compile and run a java program without writing main()?
|
A. |
Yes |
B.
|
No |
C.
|
cant say
|
D.
|
May be
|
|
Answer: Option A
Explanation:
Yes,we can compile and run a hava program withour writing main(). |
|
23. |
A ______________ variable is a variable i.e. declared locally inside a method and is available only within that method.
|
A. |
local |
B.
|
global |
C.
|
both
|
D.
|
static
|
|
Answer: Option A
Explanation:
A local variable is a variable i.e. declared locally inside a method and is available only within that method. |
|
24. |
____________________ is a keyword that refers to the objet of the class where it is used
|
A. |
static |
B.
|
this |
C.
|
super
|
D.
|
extends
|
|
Answer: Option B
Explanation:
this is a keyword that refers to the objet of the class where it is used |
|
« prev
next »