Because the package java.lang.annotationdoes not match the package java.lang. These are just different packages.
Imagine that if importing one package imported all packages "under", then
import java.*;
will import almost everything into standard libraries, but thatβs not how it works. Import statement
import foo.*;
just imports all types in the package foo- it does not import anything in any other packages that start with foo..