233). Which of the following modifier means a particular variable cannot be accessed within the package?

[A]private
[B]public
[C]protected
[D]default

Show Answer

234). How can a protected modifier be accessed?

[A]accessible only within the class
[B]accessible only within package
[C]accessible within package and outside the package but through inheritance only
[D]accessible by all

Show Answer

235). What happens if constructor of class A is made private?

[A]Any class can instantiate objects of class A
[B]Objects of class A can be instantiated only within the class where it is declared
[C] Inherited class can instantiate objects of class A
[D]classes within the same package as class A can instantiate objects of class A

Show Answer

236). All the variables of interface should be?

[A]default and final
[B]default and static
[C]public, static and final
[D]protect, static and final

Show Answer

237). What is true of final class?

[A]Final class cause compilation failure
[B] Final class cannot be instantiated
[C]Final class cause runtime failure
[D]Final class cannot be inherited

Show Answer

238). How many copies of static and class variables are created when 10 objects are created of a class?

[A]1, 10
[B]10, 10
[C]10, 1
[D]1, 1

Show Answer

239). How many copies of static and class variables are created when 10 objects are created of a class?

[A]1, 10
[B]10, 10
[C]10, 1
[D]1, 1

Show Answer

240). Can a class be declared with a protected modifier.

[A]True
[B]False
[C]none
[D]none

Show Answer

241). Which is the modifier when there is none mentioned explicitly?

[A]protected
[B]private
[C]public
[D]default

Show Answer