Downcast will fail. : Object Cast : Class Interface C# Source Code


Custom Search

C# Source Code » Class Interface » Object Cast »

 

Downcast will fail.








    
 

class Employee { }
   
class ContractEmployee : Employee { }
   
class CastExample3
{
    public static void Main ()
    {
        ContractEmployee ce = (ContractEmployee)new Employee(); 
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Class Interface
» Object Cast