Manejar PROPERTIES con SINGLETON
import java.util.ResourceBundle;
public abstract class MyProperties {
private static ResourceBundle myResources;
public static String getProperty(String key){
if(myResources==null){
myResources = ResourceBundle.getBundle("hola");
}
return myResources.getString(key);
}
public static void main(String[] args){
System.out.println(MyProperties.getProperty("titulo"));
}
}
0 comentarios