i am developing windows form application . i need to implement single ton design project. when implementing the singleton in two classes which are in same package it works correctly but implementing the two classes in different package by justing creating object for both classes in that class. how can I implement that.here code ex
public class Singleton
{
private static Singleton instance;
B b=new B();
private Singleton() {}
public static Singleton Instance
{
get
{
if (instance == null)
{
instance = new Singleton();
}
return instance;
}
}
public void a()
{
}
b.c();
}
public class B
{
SingleTon single=new SingleTon.Instance;
single.a()
public void c()
{
}
}