Output
Object A : is created
Object B : is created
Object B : is created
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Nilesh ShahRank #42 · 34.2K reputationPosted Jun 6, 2017, 6:48 AM EDT
Rajkiran SwainRank #165 · 14.4K reputationPosted Jun 7, 2017, 2:52 AM EDT
Seshadri M66 reputationPosted Jun 7, 2017, 8:58 PM EDT
I have tried code but still it show error Singletonclass inaccessable.
{
public class loggerclasses
{
private loggerclasses()
{
}
{
get
{
if (instances == null)
{
instances = new loggerclasses();
}
}
}
public class A : loggerclasses
{
public void classa()
{
Console.WriteLine(" object A: is created");
}
}
{
static void Main(string[] args)
{
A obj =new A();
obj.classa();
}
}
Vivek KumarRank #272 · 9.3K reputationPosted Jun 7, 2017, 11:34 PM EDT