Hello,
I get warnings when trying to compile this code:
public class Point3D : Point2D
{
public void WriteXml(XmlWriter w)
{
// TODO
}
public XmlSchema GetSchema()
{
// TODO
return null;
}
public void ReadXml2(XmlReader reader)
{
// TODO
}
}
public class Point2D : IXmlSerializable
{
public void WriteXml(XmlWriter w)
{
}
public XmlSchema GetSchema()
{
return null;
}
public void ReadXml(XmlReader reader)
{
}
}
class1.cs(23,15): warning CS0108: The keyword new is required on
'Point3D.WriteXml(System.Xml.XmlWriter)' because it hides inherited member
'Point2D.WriteXml(System.Xml.XmlWriter)'
class1.cs(65,15): (Related location)
class1.cs(32,20): warning CS0108: The keyword new is required on
'Point3D.GetSchema()' because it hides inherited member
'Point2D.GetSchema()'
class1.cs(73,20): (Related location)
class1.cs(38,15): warning CS0108: The keyword new is required on
'Point3D.ReadXml(System.Xml.XmlReader)' because it hides inherited member
'Point2D.ReadXml(System.Xml.XmlReader)'
class1.cs(79,15): (Related location)
Why can I not overload functions this way? Point3D.WriteXml is not called
when I think it should be. Can someone explain this to a C++ programmer?
Thanks!
--
Daniel
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?