public void ParentClassExplicitInterface() { NewAndOverrideClasses.IHelloWorld parentClass = new NewAndOverrideClasses.ParentClass(); System.Diagnostics.Debug.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name); System.Diagnostics.Debug.WriteLine(parentClass.SayHelloWorld()); }
public void ParentClassCallingHelperMethod() { var parentClass = new NewAndOverrideClasses.ParentClass(); System.Diagnostics.Debug.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name); System.Diagnostics.Debug.WriteLine(parentClass.CallMethodToSayHelloWorld()); }
public void DeclareAndChangeVariableType() { NewAndOverrideClasses.ChildClassNew childClass = new NewAndOverrideClasses.ChildClassNew(); NewAndOverrideClasses.ParentClass newChildClass = childClass; System.Diagnostics.Debug.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name); System.Diagnostics.Debug.WriteLine(""); System.Diagnostics.Debug.WriteLine("Child variable"); System.Diagnostics.Debug.WriteLine(childClass.SayHelloWorld()); System.Diagnostics.Debug.WriteLine(""); System.Diagnostics.Debug.WriteLine("Parent variable"); System.Diagnostics.Debug.WriteLine(newChildClass.SayHelloWorld()); }
public void ParentClassSayingHelloWorld() { var parentClass = new NewAndOverrideClasses.ParentClass(); System.Diagnostics.Debug.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name); System.Diagnostics.Debug.WriteLine(parentClass.SayHelloWorld()); }
public void ParentClassExplicitInterface() { NewAndOverrideClasses.IHelloWorld parentClass = new NewAndOverrideClasses.ParentClass(); System.Diagnostics.Debug.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name); System.Diagnostics.Debug.WriteLine(parentClass.SayHelloWorld()); }