SHARE
TWEET

Untitled

a guest Jul 12th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. libreriaConSingleton.jar - dipendo da libreriaDipedente.jar
  2.  
  3. import libreriaDipedente.ClasseCheMiServe;
  4. class Singleton{
  5.   private Singleton(){}
  6.  
  7.   private Singleton mySingleton;
  8.  
  9.   private ClasseCheMiServe dipedenza;
  10.   private String host;
  11.  
  12.   private Singleton(host,username, password){
  13.       dipedenza = new ClasseCheMiServe(username,password);
  14.   }
  15.  
  16.    public static getInstance(){
  17.       if (mySingleton == null)
  18.         return new Singleton("pinco",pallo");
  19.    }
  20. }
  21.  
  22. __
  23.  
  24. import libreriaConSingleton.Singleton;
  25.  
  26. class Test{
  27.   public void doAction(String[] args){
  28.      Singleton test= Singleton.getInstance();  // come faccio a capire che la classe dipende da libreriaDipedente.jar se sto chiamando solo libreriaConSingleton?
  29.   }
  30. }
  31.  
  32. class Test2{
  33.   public void doAction(String[] args){
  34.          Singleton tes2= Singleton.getInstance();
  35.   }  
  36. ...
  37.  
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top