You could use a .properties file
I'll attach an example ...
import java.io.InputStream;
import java.util.Properties;
public class TestPropeties {
public static void main(String[] args) {
Properties prop = new Properties();
String resourceName = "archivo.properties";
ClassLoader loader = Thread.currentThread().getContextClassLoader();
try {
InputStream resourceStream = loader.getResourceAsStream(resourceName);
prop.load(resourceStream);
} catch (Exception e) {
System.out.println("Ocurrió un error al cargar el archivo de propiedades");
}
System.out.println(prop.getProperty("clave"));
}
}
Where file.properties has the information in this way
clave=valor
clave2=valor2
That properties file can be opened from any class you require.