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