Java namespace? I was looking at some article which referred to namespace pollution and wanted to verify how that could be determined
you'll know when you get a conflict.
I do not understand... what does pollution of namespace mean?
https://stackoverflow.com/questions/29707809/does-namespace-pollution-in-java-or-c-sharp-exist-like-in-c
Read it, but my question was in reference to the following article: https://www.baeldung.com/java-constants-good-practices which says >Another argument against this anti-pattern is that it causes namespace pollution. Our CalculatorConstants will now be in the namespace for any of our classes that implement the interface as well as any of their subclasses.
Just don't use interfaces for constants
why not? I can just import the constant from the interface instead of implementing the interface
I don't think that's what they're for?
Обсуждают сегодня