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...

Can we have the method in drived class with the same name
which is there in base class?

Answer Posted / satya

In C#, derived classes can contain methods with the same
name as base class methods.

*

The base class method must be defined virtual.
*

If the method in the derived class is not preceded by
new or override keywords, the compiler will issue a warning
and the method will behave as if the new keyword were present.
*

If the method in the derived class is preceded with
the new keyword, the method is defined as being independent
of the method in the base class.
*

If the method in the derived class is preceded with
the override keyword, objects of the derived class will call
that method instead of the base class method.
*

The base class method can be called from within the
derived class using the base keyword.
*

The override, virtual, and new keywords can also be
applied to properties, indexers, and events.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between string and stringbuffer in c#?

904


How do you mark a method obsolete?

961


Can a loop recorder detect a heart attack?

969


What is the benefit of interface in c#?

905


How do I calculate relative time?

889


Why would you use untrusted verification?

884


Why do we use dictionary in c#?

934


What is fcl in c#?

837


Can you pass value types by reference to a method?

906


What is console write in c#?

892


What is difference between array and collection in c#?

847


Explain the term inheritance in C#.

908


How to open a new form on button click in Windows forms?

913


What is Private Constructor? and it’s use? Can you create instance of a class which has Private Constructor?

930


Which of these string definitions will prevent escaping on backslashes in c#?

958