bobleny
07-16-2009, 10:12 AM
Hey, anyone here familiar with C#?
I have a parent child class much like this:
Parent class
namespace zzz
{
public abstract class Parent
{
public Parent()
{
// Stuff
}
public string Print()
{
return "Words";
}
}
}
Child class
namespace zzz
{
public class Child : Parent
{
public Child()
{
// Stuff
}
public string Print()
{
return "Different Words";
}
}
}
Main class
namespace zzz
{
public Testy
{
public static void main()
{
Child name = new Child();
Console.WriteLine(Child.Print() + "\n");
}
}
}
The output of the writeline is "Words". How do I get it to output "Different Words?"
I have a parent child class much like this:
Parent class
namespace zzz
{
public abstract class Parent
{
public Parent()
{
// Stuff
}
public string Print()
{
return "Words";
}
}
}
Child class
namespace zzz
{
public class Child : Parent
{
public Child()
{
// Stuff
}
public string Print()
{
return "Different Words";
}
}
}
Main class
namespace zzz
{
public Testy
{
public static void main()
{
Child name = new Child();
Console.WriteLine(Child.Print() + "\n");
}
}
}
The output of the writeline is "Words". How do I get it to output "Different Words?"