Im currently undertaking a memory sweep of my application and i just have a quick question about what to do with public static variables within a class when the class is no longer required. An example of this is network requests:
public class NetworkRequest {
public static String URL = "www.somestring.com/endpoint?withsomeparameters=true"
public void perform(){
// the rest of the request logic...
}
}
After i have initiated this class like so:
NetworkRequest networkRequest = new NetworkRequest();
networkRequest.perform();
networkRequest = null;
Is my public static field preventing this class from being correctly garbage collected?
Then the same question again for:
public static finalprivate staticprivate static final.
Thanks again for your help