summaryrefslogtreecommitdiff
path: root/Year_2/SE/design_patterns/singleton/Main.java
blob: 5d05ceaf450ab443d93fa0c824a7653ac7455f39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
public class Main {
    public static void main(String[] args) {
        Logs l = Logs.getInstanceLogs();
        Logs l2 = Logs.getInstanceLogs();

        // Prints "true"
        System.out.println(l == l2);

        // Error, because the constructor is private
        // Logs l3 = new Logs();
    }
}