encapsulation

BCS ao at pathlink.com
Tue Mar 13 11:35:58 PDT 2007


Reply to arun,

> class A {
> private int c=0;
> }
> void main() {
> A a = new A();
> printf("%d",a.c);
> }
> consider the above code snippet..... y there is no error in printf
> statement a.c , since attribute "c" is private ????
> 

Everything inside of a module (a.k.a. file) is visible to everything else 
inside of that module.





More information about the Digitalmars-d mailing list