public class IMF {
private static IMF imf;
public static IMF getFund() {
synchronized (imf) {
if(imf == null)
imf = new IMF();
return imf;
}
}
private IMF() {
}
}
package com.codegym.task.task17.task1707;
/*
IMF
*/
public class Solution {
public static void main(String[] args) {
IMF fund = IMF.getFund();
IMF anotherFund = IMF.getFund();
System.out.println(fund == anotherFund );
}
}