I need to create a 100 or more static final constants in my application and I can achieve this is following two ways as per my understanding:
- Creating a simple java
class
and createstatic
final
field in that - Creating an interface an put all variable in that because all field in an interface is implicitly
static
final
I have these question in above approach:
- Which one is right approach to achieve this?
- Which one is memory efficient approach?
- Is there any design pattern to achieve this?