Java-Programming Solved MCQs (Set-3)
Java-Programming Solved MCQs (Set-3)
A. By value
B. by reference
C. both a & b
D. none of these
o m
.c
Answer: A
te
a
specifier is used for it? q M
52. Which of these is used as default for a member of a class if no access
c
A. private M
B. public
D. protected
Answer: C
53. Which of these keywords is used to refer to member of base class from
a sub class?
A. upper
B. super
C. this
Answer: B
A. class B + class A {}
C. class B extends A {}
Answer: C
o m
B. Variables declared in interfaces are implicitly public, static, and final.
.c
C. An interface contains any number of method definitions.
te
a
D. The keyword implements indicate that an interface inherits from another.
Answer: B
q M
c
M
56. Which of these keywords is used to define interfaces in Java?
A. interface
B. Interface
C. intf
D. implements
Answer: A
57. Which of these can be used to fully abstract a class from its
implementation?
A. Objects
B. Packages
Answer: C
A. Public
C. private
Answer: A
A. import
o m
B. Import
.c
C. implements
te
a
D. Implements
q M
Answer: C
c
M
60. Which of the following is correct way of implementing an interface
salary by class manager?
Answer: B
A. import
B. package
C. classpath
D. public
Answer: B
A. public
B. private
C. protected
D. none
Answer: B
o m
.c
63. Which of the following package stores all the standard java classes? a)
jav
te
a
A. lang
q M
B. java c
C. java.util M
D. java.packages
Answer: A
A. Object
B. Packages
Answer: B
65. Which of this access specifies can be used for a class so that its
objects can be created by a different class in another package?
A. Public
B. Protected
C. No Modifier
Answer: A
A. import pkg.
B. Import pkg.
C. import pkg.*
o m
D. Import pkg.*
.c
Answer: C
te
a
q M
67. Which of the following is incorrect statement about packages?
c
M
A. Package defines a namespace in which classes are stored.
D. A package can be renamed without renaming the directory in which the classes are stored.
Answer: D
A. CHARAT()
B. chatat()
C. charAt()
D. ChatAt()
Answer: C
B. Sizeof()
C. lengthof()
D. length()
Answer: D
A. try
o m
B. finally
.c
te
C. thrown
a
D. catch
q M
Answer: C
c
M
71. The code within the ----------- block will always be executed whether or
not an exception is thrown.
A. try..catch
B. finally
C. throw
D. throws
Answer: B
A. try..catch
B. finally
C. throw
D. throws
Answer: A
A. try
B. finally
C. throw
D. catch
Answer: C
o m
74. Which of these classes is related to all the exceptions that can be
caught by using catch? .c
te
A. Error a
B. Exception
q M
c
C. None of these
D. a & b
M
Answer: B
75. Which of these classes is related to all the exceptions that cannot be
caught?
A. Error
B. Exception
C. None of these
D. a & b
Answer: A
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