In method overriding there is parent class has a method(function) with virtual keyword and this method is overridden in child class.as shown in example
Example:
namespace CA_Method_overriden
{
class student
{
public int age;
public string name;
public virtual string mark()
{
return "35";
}
}
class girlstudent : student
{
public override string mark()
{
return "50";
}
}
class boystudent : student
{
public override string mark()
{
return "70";
}
}
class Program
{
static void Main(string[] args)
{
girlstudent objgs = new girlstudent();
Console.WriteLine(objgs.mark());
boystudent objbs = new boystudent();
Console.WriteLine(objbs.mark());
}
}
}
OUTPUT:
50
70
See Also :
- how to crack IDM
- How to change name of start button in xp
- how to connect to facebook without Internet connec...
- How to customize send to menu.
- How to hide folder without any software.
--
/\/ir@\/ <(.'.)>
0 comments:
Post a Comment
Thanks for comment