![]() |
Sign Up! | Tags | Domains | Statistics | Options | Advanced Search |
Tagged: tech
What happens when we have code as bellow class B { public virtual void Virt(){ Console.WriteLine("Base::Virt"); } } class Program { static void Main(string[] args){ B b = null; b.Virt(); // throws System.NullReferenceException } } Obviously we have a null reference exception being thrown. If you see the IL the call looks like L_0000: nop L_0001: ldnull L_0002: stloc.0 L_0003: ldloc.0 L_0004 … Continue Reading »