Em Ter, 2010-03-23 às 19:41 +0100, Carl Mäsak escreveu:
> <masak> um, so 'protected' is when the deriving classes can see the
> attribute?
> <jonalv> yup
> <masak> that's what 'private' means in Perl 6.
> <jonalv> what? so there's only really 'public' and 'protected', but no
> 'private'?
> <masak> basically, yes. although 'protected' in Java is called
> 'private' in Perl 6.

Au contraire. In Perl you only have 'protected'. There is no "public" in
the same sense as java. There is no direct access to object's
attributes, it is always accessed through methods.

In java, a public attribute is accessed without the mediation of any
method.

daniel

Reply via email to