Q12.webp
red_rose

Q12.webp

  • Media owner red_rose
  • Ngày thêm
Kizspy | Question: 12
(Choose 1 answer)
Identify the correct implementation of the Singleton pattern in C#?
A. public class Singleton
}
private static Singleton instance = null;
private static readonly object lockObject = new object();
private Singleton() {}
public static Singleton Instance
{
get
}
lock (lockObject)
{
if (instance == null)
}
instance new Singleton();
}
return instance:
}
}
}
}
B. public class Singleton
public Singleton() { }
}
C. public class Singleton
{
private static Singleton instance = new Singleton();
Publi
n() {}

Thông tin

Category
PRN212
Thêm bởi
red_rose
Ngày thêm
Lượt xem
2,650
Lượt bình luận
6
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom