Knowee
Questions
Features
Study Tools

nswerIn order to restrict a variable of a class from inheriting to subclass, how variable should be declared?OptionsProtectedPublicPrivateStatic

Question

nswerIn order to restrict a variable of a class from inheriting to subclass, how variable should be declared?OptionsProtectedPublicPrivateStatic

🧐 Not the exact question you are looking for?Go ask a question

Solution

The variable should be declared as Private. Private members of a class are not accessible in the subclass.

Similar Questions

Select the correct answerIn order to restrict a variable of a class from inheriting to subclass, how variable should be declared?OptionsPrivateProtectedPublicStatic

correct answerIn order to restrict a variable of a class from inheriting to subclass, how variable should be declared?

A top-level class may have which one of the following access modifiers?Optionsprivatepackageprotectedpublic

A class member declared protected becomes a member of subclass of which type?Optionsprivate memberpublic memberprotected memberstatic member

ct answerWhich of these keywords can be used to prevent Method overriding?Optionsstaticprotectedconstantfinal

1/3

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.