Search code examples
javareadability

Is it good to Sharing constant strings in Java across many classes?


I'd like to have Java constant strings at one place and use them across whole project?I am confusing Is it a good practice for better readability or not?


Solution

  • If you think that your Strings are going to be referenced in many flows, then it is good to use. Moreover, it is a widely accepted practice as well.