static void Main(string[] args) { Singleton fromTeacher = Singleton.GetInstance; fromTeacher.PrintDetails("From Teacher"); Singleton fromStudent = Singleton.GetInstance; fromStudent.PrintDetails("From Student"); Console.ReadLine(); }
static void Main(string[] args) { Singleton fromEmployee = Singleton.Instance; fromEmployee.PrintDetails("This is the first message"); Singleton fromStudent = Singleton.Instance; fromStudent.PrintDetails("This is the second message"); Console.ReadLine(); }
private static void PrintCustomer() { Singleton s1 = Singleton.Instance; s1.PrintDetails("Customer"); }
private static void PrintEmployee() { Singleton s2 = Singleton.Instance; s2.PrintDetails("Employee"); }
private static void DisplayEmployee() { Singleton employee = Singleton.GetInstance; employee.PrintDetails("From Employee"); }
private static void DisplayStudent() { Singleton student = Singleton.GetInstance; student.PrintDetails("From Student"); }
private static void FromStu() { Singleton fromStudent = Singleton.GetInstance; // suppose this was needed in student class fromStudent.PrintDetails("from student"); }
private static void FromEmp() { Singleton fromEmployee = Singleton.GetInstance;// suppose this was needed on employee class fromEmployee.PrintDetails("from employee"); }
private static void PrintEmployeeDetails() { Singleton fromEmployee = Singleton.GetInstance; fromEmployee.PrintDetails("from employee"); }
private static void PrintStudentDetails() { Singleton fromStudent = Singleton.GetInstance; fromStudent.PrintDetails("from student"); }
public static void PrintObjectA1Details() { Singleton objectA1 = Singleton.GetInstance; objectA1.PrintDetails("This is from Object A1, Thread Safety"); }