G
Guest
look at the sampl
<pre
using System
class Bas
public virtual void Print(
Console.WriteLine( "Executing the base." )
class Derived : Bas
private new void Print(
Console.WriteLine( "Executing the derived." )
base.Print()
public void Print2(
Print()
class MainAp
static void Main(
Derived obj = new Derived()
obj.Print()
Console.WriteLine( "" )
obj.Print2()
</pre
now I basically have 2 versions of Print defined for Derived. one for external, one for internal. should the compiler actually allow this in the first place?
<pre
using System
class Bas
public virtual void Print(
Console.WriteLine( "Executing the base." )
class Derived : Bas
private new void Print(
Console.WriteLine( "Executing the derived." )
base.Print()
public void Print2(
Print()
class MainAp
static void Main(
Derived obj = new Derived()
obj.Print()
Console.WriteLine( "" )
obj.Print2()
</pre
now I basically have 2 versions of Print defined for Derived. one for external, one for internal. should the compiler actually allow this in the first place?