static void Main(string[] args) { Employee objEmployee = new Employee(); objEmployee.AcceptDetails(10, "Jack"); IGet objGet = objEmployee as IGet; if (objGet != null) { objGet.display(); } else { Console.WriteLine("Invalid casting occurred"); } }
static void Main(string[] args) { Employee objEmployee = new Employee(); objEmployee.AcceptDetails(10, "Jack"); IGet objGet = objEmployee as IGet; if (objGet != null) { objGet.display(); } else { Console.WriteLine("Invalid casting occurred"); } }