Похожие чаты

How to determine if a class is loaded in the

Java namespace? I was looking at some article which referred to namespace pollution and wanted to verify how that could be determined

7 ответов

4 просмотра

you'll know when you get a conflict.

Roy- Автор вопроса
Пользователь 61a11
you'll know when you get a conflict.

I do not understand... what does pollution of namespace mean?

Roy
I do not understand... what does pollution of name...

https://stackoverflow.com/questions/29707809/does-namespace-pollution-in-java-or-c-sharp-exist-like-in-c

Roy- Автор вопроса
Пользователь 61a11
https://stackoverflow.com/questions/29707809/does-...

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.

Roy- Автор вопроса
Пользователь 61a11
Just don't use interfaces for constants

why not? I can just import the constant from the interface instead of implementing the interface

Похожие вопросы

Обсуждают сегодня

Hi everyone! I have a two-folded message to share today. First: updates and news, as we are being asked for those. We still want to go like we did the last 6 years: we w...
Marten | Unibright.io
31
комрады, че-та лыжы не едут var tmpFont: TFont; begin tmpFont:= TFont.Create; try case rgFontColor.ItemIndex of 0: tmpFont.Color:= clWindowText; 1: tmpFo...
Ed Doc
34
Интересно, нет ли какого-то способа получить из dll не адрес самой метки, а адрес со смещением?
The Bird of Hermes
54
generic procedure function test<T>(param: T); type case T of longint: NewT = word; longword: NewT = byte; end; var v1: NewT; Как это можно сделать? Чтобы у меня...
notme
21
Guys, mexc or gate.io (only exchanges with the token I need, unfortunately): depositing xmr, not withdrawing, is safe rn, or can fall for shotgun kyc? (I heard gate is alread...
another one bites the dust
20
The cynical view of ETFs in crypto is that it denotes the capture of the industry leading projects like Bitcoin by legacy/establishment infrastructure. A glass half full (or ...
ZecMec 21
1
Whoa, did you guys see this FUNToken Seed Grant announcement? 💸
Noah Noure
37
Делал задачу вот такую https://stepik.org/lesson/4985/step/9?unit=1083 получилось такое https://play.haskell.org/saved/ipKrepqe оно работает, тестов много не писал, но работае...
Fedor
22
hello guys, I have a laptop, if you connect wired headphones, the sound will come from the headphones and the built-in speakers AT THE SAME TIME. How can I make the sound com...
El Pepe
21
Всем привет, прошу совета по сложившейся ситуации: Windows приложение подключается к БД MySQL используя Firedac. При работе с версией MySQL 5.7 все отлично, но когда подключаю...
Constantine
6
Карта сайта