how can we use protected keyword?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sivakoti
    New Member
    • Aug 2010
    • 4

    #1

    how can we use protected keyword?

    how can we use protected keyword?
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    The protected keyword is used when the base class contains members that need to be accessible in a derived class without having to use a base class member function.

    This is usually done when the base class is incomplete and it to be completed by a derived class. Here the intent is to create and use derived objects as deriuved objects but have the base class contain the data or ogic that is common to all derived classes without having to expose this information to classes outside the hierarchy.

    Comment

    Working...