Why child package can't use the parent package default class or default method?

Viewed 47

For example

package a
    |_ public class AA { a(){} }
    |_ class A {}

package a.b
    |_ 
      class B {
        b() {
          new AA().a(); // error
          new A(); // error
        }
      }

I want to know why java design the default. Why the package a.b is not the package a?

0 Answers
Related