encapsulation

arun s 1986.arun at gmail.com
Tue Mar 13 10:40:18 PDT 2007


BCS Wrote:

> 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.
> 
> 
how is the concept of data hiding and encapsulation implemented in D ?????



More information about the Digitalmars-d mailing list