On 2010-10-04 21:37, bearophile wrote:
Andrei:

I agree. Class A can access private methods of class B as long as both
defined in the same module. If it has access to private methods, why
can't it override them? Makes little sense, if you ask me, especially
given that user may prevent overriding methods using "final" keyword.
And the "package" also implying final is just ridiculous!

This is a very good argument that in my mind settles the case.

I am not expert about this, but ignoring private attributes among 
classes/structs in the same module may be useful, but it's a dirty thing. If 
you split in two parts a module that contains two classes that access each 
other private members, the code stops working. Overriding private methods makes 
the situation even dirtier. I don't think C#/Java programmers will appreciate 
this :-)

Bye,
bearophile

If you have two classes in one file in Java you can access private methods from the other class.

--
/Jacob Carlborg

Reply via email to