Is there way for a class to \'remove\' methods that it has inherited?
E.g. if I don\'t want my class to have a ToString() method can I do something so t
As others pointed out, you can't "remove" a method, but if you feel it has wronged you in some way you can hide it in your derived class.
From Microsoft's documentation (now retired):
class Base
{
public static void F() {}
}
class Derived: Base
{
new private static void F() {} // Hides Base.F in Derived only
}
class MoreDerived: Derived
{
static void G() { F(); } // Invokes Base.F
}