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 wrong with the sample program below?

999


What is xaml in c#?

941


What is JIT (just in time)? how it works?

1005


What is razor view in c#?

839


If the interface in c# only contains the declaration of the methods and we need to define those methods in the class, then why we use the interface?

1017


How do you create partial methods?

985


What is .net c#?

914


What is thread in c#?

960


What is inumerable?

1051


What does assert() do in c#?

1022


What is jagged array in c#?

1131


Which technology is best for desktop application?

867


Can we have static indexer in c#?

916


Can hashset contain duplicates c#?

955


What is assembly and dll in c#?

947