Voici mon code: class A { static A obj = new A(); static int num1; static int num2=0; private A() { num1++; num2++; } public static A getInstance() { return obj; } } public class Main{ public static void main(String[] arg) { A obj = A.getInstance(); System.out.println(obj.num1);