Suppose a program has the following class declaration//Declaration of checkpoint
ID: 3796072 • Letter: S
Question
Suppose a program has the following class declaration//Declaration of checkpoint class. class checkpoint private int a; protected int b int c void set A void set C Answer the following questions regarding the class: Suppose another class, Quiz, is derived from the checkpoint class as: class Quiz: protected checkpoint indicates whether each member of the class is private protected public or inaccessible. set A set B set C Suppose the Quiz class, derived from the checkpoint class, is declared as class Quiz: public checkpoint indicates whether each member of the checkpoint class is private, protected public or inaccessible: set A set B set CExplanation / Answer
Please follow this concept to solve the question :
When base class is protected ,public and protected methods and variables will become protected.So for part (a) a will be private , else will all be protected (b,c ,setA,setB,setC)
When base class is public than public members will be public ,protected member will be protected and private will be private. So a will be private and inaccessible, b ,c and setA will remain protected and setB and setC will remain public.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.