Select the correct answerIn order to restrict a variable of a class from inheriting to subclass, how variable should be declared?OptionsPrivateProtectedPublicStatic
Question
Select the correct answerIn order to restrict a variable of a class from inheriting to subclass, how variable should be declared?OptionsPrivateProtectedPublicStatic
Solution
The correct answer is "Private". A private variable in a class is not accessible in the subclass, thus restricting it from inheriting to the subclass.
Similar Questions
nswerIn order to restrict a variable of a class from inheriting to subclass, how variable should be declared?OptionsProtectedPublicPrivateStatic
correct answerIn order to restrict a variable of a class from inheriting to subclass, how variable should be declared?
answerA class member declared protected becomes a member of subclass of which type?Optionspublic memberprotected memberprivate memberstatic member
Select the correct answerWhich of these keywords can be used to prevent Method overriding?Optionsprotectedconstantstaticfinal
A top-level class may have which one of the following access modifiers?Optionsprivatepackageprotectedpublic
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.