java - Interface Vs Final class to store the final variables -


i have class contains final variables. e.g:

public class constants {     public static final string prefix = "some prefix";     public static final string suffix = "some suffix";     //and on... } 

which type recommended here - interface or final class?

interfaces used define contract. in code copy paste, these constants should defined in final class. check what best way implement constants in java?


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -