Brian

27%
Flag icon
If you make heavy use of the constants exported by a utility class, you can avoid the need for qualifying the constants with the class name by making use of the static import facility:
Brian
I don’t really like this static import thing. I think it assumes everyone is using an IDE, as it hides where things are coming from. One of the things o liked about java (especially when diving into unfamiliar codebase) was how explicit everything needs to be.
Robert
· Flag
Robert
On the spectrum of when to use static imports, I think I'm somewhat closer to the end you're on (I like the clarity, too). But there are some contexts where domain awareness is reasonably expected to …
Effective Java
Rate this book
Clear rating
Open Preview