I apologize if this has been asked before.
I have the following scenario:
public class Distress{
private static Distress distressIns;
private MyFirstClass aClass;
private MySecondClass bClass;
private Distress(){
aClass = new MyFirstClass();
bClass = new MySecondClass();
}
///update: this is a singleton class
public static getIns(){
if (distressIns == null){
distressIns = new Distress();
}
return distressIns;
}
public static destroyIns(){
distressIns = null;
}
}
In the above scenario if someone calls destroyIns()
, would aClass
and bClass
also become null
?