Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

If I want to override a method 1 of class A and in class b
then how do you declare ?

Answer Posted / sridevi

declare method1 as virtual in classA and then create classB
as derived class of ClassA and override method1 in classB.

class ClassA{
public virtual add();

}

class ClassB:ClassA{
public overrride add(){

console.WriteLine("Im in derived");

}

}

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is view model in c#?

851


What is sorted list in c#?

896


What is managed or unmanaged code?

1067


What is overloading with example?

921


1. Describe page life cycle?

2110


What is verbatim literal in c#?

890


Why use “using” in c#?

961


What are data types with examples?

985


What is the name of c# compiler?

1150


What are async and await?

946


Define Final Class in C#

1031


What is trim in c#?

1012


Can a loop recorder detect a heart attack?

1016


How do you implement thread synchronization in c#?

895


what is a enumeration in c#

1047