Q. What is the difference between protected and private access specifiers in inheritance?

  • (A) Both are inheritable but private is accessible in the derived class.
  • (B) private member is not inheritable and not accessible in derived class.
  • (C) protected member is inheritable and also accessible in derived class.
  • (D) Both are inheritable but protected is not accessible in the derived class.
πŸ’¬ Discuss
βœ… Correct Answer: (C) protected member is inheritable and also accessible in derived class.

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
261
Total Visits
πŸ“½οΈ
5 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
92%
Success Rate