J
Joona I Palaste
(e-mail address removed) scribbled the following:
Erm, yes. If you read my post again you'll see I wrote "protected =
subclasses and package only". With this I meant to say that a protected
method or field is visible to all subclasses, no matter what package
they are in, and to all classes in the same package as the original
class, even if they're not its subclasses.
--
/-- Joona Palaste ([email protected]) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"'It can be easily shown that' means 'I saw a proof of this once (which I didn't
understand) which I can no longer remember'."
- A maths teacher
Just for completeness: protected isn't just package only. A protected
method in a public class can be overridden by subclasses in other
packages; a default-modifier method cannot.
Erm, yes. If you read my post again you'll see I wrote "protected =
subclasses and package only". With this I meant to say that a protected
method or field is visible to all subclasses, no matter what package
they are in, and to all classes in the same package as the original
class, even if they're not its subclasses.
--
/-- Joona Palaste ([email protected]) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"'It can be easily shown that' means 'I saw a proof of this once (which I didn't
understand) which I can no longer remember'."
- A maths teacher