How do packages affect inheritance in Java?
Inheritance is concerned with the properties and behaviour that a class aquires by extending a superclass, and the polymorphic types it acquires by implementing interfaces. The package a class belongs to affects the inheritance patterns it can adopt and may pass down to subclasses through its visibility modifiers, but it is also about assigning a fully qualified class name. A fully qualified class name like com.example.util.Date distinguishes a non-standard Date class from the Java API class java.util.Date and the java.sql.Date class for example. That means you can use all three Date types in the same class and refer to them specifically without ambiguity. The package assignment of a class combined with the implicit package visibility, public, protected or private visibility modifiers on the class overall control which other classes can extend it. When those modifiers are applied to a variable or method they affect which can be accessed by other classes and subclasses. So the package a