If you are not going to change your URL more often, then instead of the getter/setter method I will say that you can save static directly
public static String google_url = "http://google.com"; public static String yahoo_url = "http://yahoo.com";
By preserving the static method, it may happen that due to some static setter problem, the values ββare removed (reset in the original). So in this case, it will return you the original constant of the static value.
UPDATE:
If you are going to update your URL dynamically , then a static method will be the best option.
public static String sUrlBase = "http://google.com"; public static String getsUrlBase() { return sUrlBase; } public static void setsUrlBase(String sUrlBase) { this.sUrlBase = sUrlBase; }
source share