Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java singleton

public class DB {
    // champs de l'objet

    private DB(){
        // initialisation des champs
    }

    private static final DB INSTANCE = new DB();
    public static DB getInstance(){
        return INSTANCE;
    }
}
Source by dzone.com #
 
PREVIOUS NEXT
Tagged: #java #singleton
ADD COMMENT
Topic
Name
9+2 =