I am using the same final constants in different classes, like
class A { private static final String NAME = "Name"; }
class B { private static final String NAME = "Name"; }
class C { private static final String NAME = "Name"; }
I am trying to simplify the code here instead of using the same constants in multiple classes.
In my view I have some ideas,
- creating an enum with constants
- creating a final class with constants
- create a property file with all constants and use read in Java file
Could you give adviseon what is the efficient way to do it?.
or is there any design pattern to use it in an efficient manner?