public struct StructToHide
{
String str;
public string FunctionInStructure()
{
str = "This is from base class FunctionInStructure";
return str;
}
}
Then the following structure in the derived class with a keyword "new" as below
public new struct StructToHide
{
String str;
public string FunctionInStructure()
{
str = "This is from derived class FunctionInStructure";
return str;
}
}
Now try it from the form load event of the web form as below
private void Page_Load(object sender, System.EventArgs e)
{
WebApplication1.DerivedClass.StructToHide struct1 = new WebApplication1.DerivedClass.StructToHide();
Label1.Text = struct1.FunctionInStructure();
}
You will get messages from the hiding structure. So another point as overriding supports methods, properties and some limited class members. But hiding supports more like that of structures.
My opinion is that feel free to use hiding as I think it's still not widely used. It is very helpful in case u bought a 3rd party control/dll and you want to use that control without some methods of that control/dll. So just hide them and use other functionalities. Besides you can define your own methods with the same name of those control/dll methods regardless of whether that methods are not defined as virtual/abstract. So let me finish this part and continue your part of finding more.