Java-Programming Solved MCQs (Set-2)
Java-Programming Solved MCQs (Set-2)
Java-Programming Solved MCQs (Set-2)
C. abstract
D. public
Answer: A
A. Identifier
B. local variable
C. instance variable
D. global variable
Answer: C
A. Static variable
C. instance variable
D. global variable
Answer: B
30. Defining methods with same name and different no. of parameters are
called
A. Method overriding
o m
B. method overloading
.c
C. Dynamic method dispatch
te
a
D. none of the above
q M
Answer: B
c
M
31. _________ is used to initialize objects.
A. Methods
B. arguments
C. constructors
D. new keyword
Answer: C
A. int
B. float
C. void
Answer: D
A. finalize
B. delete
C. class
D. constructor
Answer: D
o m
.c
34. Which operator is used by Java run time implementations to free the
te
memory of an object when it is no longer needed?
a
A. delete
q M
B. free c
C. new M
D. None of the mentione
Answer: D
35. Which of these access specifiers must be used for main() method?
A. private
B. public
C. protected
Answer: B
36. Which of these is used to access member of class before object of that
class is created?
A. public
B. private
C. static
Answer: C
A. class
B. this
C. new
D. malloc
o m
Answer: C
.c
t e
a object
38. The keyword used to refer the current
q M
A. class
c
B. this M
C. new
D. malloc
Answer: B
A. destructor
B. terminate()
C. finalize()
D. destroy()
Answer: C
A. abstract class
B. parent class
D. None of above
Answer: C
A. Inherits
B. extends
C. implements
o m
D. import
.c
te
Answer: B
a
q M
42. The use of final keyword with method definition
c
A. Supports method overriding M
B. implements dynamic method dispatch
D. none of these
Answer: C
43. Identify the type of inheritance when two or more subclasses inherit
the properties of a super class.
A. Multiple inheritance
B. Single inheritance
C. Multilevel inheritance
D. Hierarchical inheritance
Answer: D
44. The keyword used inside a class to refer to its immediate super class
is
B. parent
C. base
D. none of these
Answer: A
A. abst
B. abstract
C. Abstract
D. abstract class
Answer: B
47. If a class inheriting an abstract class does not define all of its function
then it will be known as?
A. abstract
B. A simple class
C. Static class
Answer: A
B. Abstract class defines only the structure of the class not its implementation.
Answer: C
o m
49. Which method defined in Integer class can be used to convert a whole
number in string type to primitive int type. .c
te
A. valueOf() a
B. intValue()
q M
c
C. parseInt()
D. getInteger()
M
Answer: C
A. System
B. Root
C. Math
D. Arithmetic
Answer: C
For Discussion / Reporting / Correction of any MCQ please visit discussion page by clicking on
'answer' of respective MCQ.
PlayStore
o m
.c
te
a
q M
c
M