For an application in android I have a global variable,
public class ConstantsUrls {
public static String GET_CART_ALL_ITEM = "store/3/cart/" + CartFunctions.ReturnUserRrQuote() + "/type/customer"
}
and have ,
public class CartFunctions {
public static String ReturnUserRrQuote() {
String user_value = "";
//some function
return user_value;
}
}
When I call a function, let A with parameter ConstantsUrls.GET_CART_ALL_ITEM
as
A(ConstantsUrls.GET_CART_ALL_ITEM);
I get the correct value as store/3/cart/100/type/customer
but when I call again
the function A with the same parameter I always get exactly the same value as store/3/cart/100/type/customer
even the ReturnUserRrQuote()
not call to get updated value for the second time.
When I call the function
A("store/3/cart/" + CartFunctions.ReturnUserRrQuote() + "/type/customer")
instead of
A(ConstantsUrls.GET_CART_ALL_ITEM);
I always get the correct working (updated correct values)
Why Global variable does not update with global function within the same Global variable. Is this Java core behave like this or any other reason?