we cannot access the dataMemebers of the class outside the class .Their members are by default-private
.So when we want to access them .The error should come as
so when we want to access them outside the class,we use the
access-identifiers
.
There are there Access specifiers.
- Memebers of public are accessible from anywhere(accissble through the object).
- Members declerad as private are only accessible within the class.
- Members are only accessible in child class.
Result:
The address of a class is same as the address of the first dataMemeber of the class