In IntelliJ I tried to create a package for my default implementation of services with name default
:
π src
ββββ π main
ββββ π java
ββββ π service
ββββ π default
β ββββ // here I can't create java classes
β
ββββ PostService.java
ββββ SearchService.java
ββββ UserService.java
The IDE prompted that you cannot create java classes in this package.
Why can't I create java classes in a package named default
?
default
is a reserved word. You cannot give your packages, classes, methods, variables, etc. any of the keywords as name.
The full list of reserved words is here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With