a) protected b) private c) public d) default Answer: d Explanation: Default is the ...
View QuestionCan a class be declared with a protected modifier.
a) True b) False Answer: b Explanation: Protected class member (method or variable) is like ...
View QuestionHow 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 Answer: a Explanation: ...
View QuestionWhat is true of final class?
a) Final class cause compilation failure b) Final class cannot be instantiated c) Final class cause runtime ...
View QuestionAll the variables of interface should be?
a) default and final b) default and static c) public, static and final d) ...
View QuestionWhat 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 ...
View QuestionHow 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 ...
View QuestionWhich of the following modifier means a particular variable cannot be accessed within the package?
a) private b) public c) protected d) default Answer: a Explanation: Private variables are accessible only within the class.
View QuestionAll the variables of class should be ideally declared as?
a) private b) public c) protected d) default Answer: a Explanation: The variables should be private and should ...
View QuestionWhich one of the following is not an access modifier?
a) Public b) Private c) Protected d) Void Answer: d ...
View Question