What is the best practice to declare a java file having only constant?
public interface DeclareConstants { String constant = \"Test\"; }
OR
- Create a Class with public static final fields.
Class
public static final
- And then you can access these fields from any class using the Class_Name.Field_Name.
Class_Name.Field_Name
- You can declare the class as final, so that the class can't be extended(Inherited) and modify....
class
final