Reputation: 95
I have not troubles with renaming packages in idea, but... I have "example" package and I want to rename it to "enum", but Idea does not allow me to do that. When I create a new package "enum", it warns me, that I will not be able to create any java classes within. What is the problem???
Upvotes: 2
Views: 933
Reputation: 3487
You cannot rename the package to enum
, because it is a reserved keyword in Java.
At the Oracle tutorial page "Naming a package" it says
In some cases, the internet domain name may not be a valid package name. This can occur if the domain name contains a hyphen or other special character, if the package name begins with a digit or other character that is illegal to use as the beginning of a Java name, or if the package name contains a reserved Java keyword, such as "int".
Upvotes: 4