-3

Possible Duplicate:
In Java, what’s the difference between public, default, protected, and private?

Is there a difference between a variable with a private status and a variable with a protected status?

private int toto; protected int tata;

Community
  • 1
  • 1

1 Answers1

0

A private attribute is only visible to the owning Class. A protected attribute is also visible for all extending Classes, this is not the case for private attributes.

Simulant
  • 16,683
  • 7
  • 55
  • 85