confuse about protected and private members of a class...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jimgym1989
    New Member
    • Sep 2008
    • 30

    #1

    confuse about protected and private members of a class...

    what is the difference between a protected and a private members of a class?
    can someone explain it to me..
    tnx..
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Private members can only be accessed by objects of the class in which the private object is defined.
    Protected members can also be accessed by objects of classes that are a sub class in which the object is defined.

    kind regards,

    Jos

    Comment

    • jimgym1989
      New Member
      • Sep 2008
      • 30

      #3
      Originally posted by JosAH
      Private members can only be accessed by objects of the class in which the private object is defined.
      Protected members can also be accessed by objects of classes that are a sub class in which the object is defined.

      kind regards,

      Jos
      thanks my friend!! :-) keep it up!!

      Comment

      Working...