Q
Quentin Huo
Hi:
I have a parent class "classA", which is like:
public abstract class classA
{
.....
public string ReturnAString()
{
return "Hello, World";
}
......
}
And I have another class "classB" inheriting from "classA", like:
public class classB
{
......
public string AMethod()
{
return ReturnAString();
}
......
}
My question is: what is the difference if I change the statement
"ReturnAString();" in the method "AMethod" of the "classB" to:
return base.RetuenAString();
They both works well, but I want to know if there is any difference between
the two statements. The "base" here means an instance of its parent class
has been created? Or maybe they are totally same?
Thanks
Q.
I have a parent class "classA", which is like:
public abstract class classA
{
.....
public string ReturnAString()
{
return "Hello, World";
}
......
}
And I have another class "classB" inheriting from "classA", like:
public class classB
{
......
public string AMethod()
{
return ReturnAString();
}
......
}
My question is: what is the difference if I change the statement
"ReturnAString();" in the method "AMethod" of the "classB" to:
return base.RetuenAString();
They both works well, but I want to know if there is any difference between
the two statements. The "base" here means an instance of its parent class
has been created? Or maybe they are totally same?
Thanks
Q.