Code below, you can make singlton class(has only one object).
public class AppFunction {
   private static AppFunction af;
   private AppFunction() {
   }
   public static AppFunction getInstance(){
       if(af!=null){
           return af;
       } else{
           af = new AppFunction();
           return af;
       }
   }
}
 
No comments:
Post a Comment