// some logic
                  
                  
                      companion object {
                  
                  
                          @Volatile
                  
                  
                          private var instance: A? = null
                  
                  
                          @JvmStatic
                  
                  
                          fun getInstance(config: Config) {
                  
                  
                              val res = instance
                  
                  
                              if (res != null) return res
                  
                  
                              synchronized (this) {
                  
                  
                                  val res2 = instance 
                  
                  
                                  if (res2 != null) return res2
                  
                  
                                  val res3 = A(config)
                  
                  
                                  instance = res3
                  
                  
                                  return res3
                  
                  
                              }
                  
                  
                          }
                  
                  
                      }
                  
                  
                  }
                  
                  
                
нет, там первый конструктор типо class Foo private constructor( val a: Service_a, val b: Service_b )
Обсуждают сегодня