Why in C# it is not allowed for derived classes to have greater accessibility than its base class.
For example this will give error : Inconsistent accessibility: bas
internal is not the same as package private in Java. The user of DerivedClass may not have or have access to the DLL that BaseClass is in so DerivedClass can't depend on it. Package privacy is a much looser concept in Java - but in your example, DerivedClass would have to be in the same package as BaseClass so there's a good chance the client user would have both of those classes so Java allows it.