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

How can you reference current thread of the method ?

962


What is dataset and dataadapter in c#?

939


What is difference between dll and exe in c#?

981


What is dataview c#?

866


What are Namespaces?

1346


What is different about switch statements in c#?

878


What is list array in c#?

871


Explain the steps to create satellite assembly?

901


What is the usage of Enumeration in C# Programming and is it good to use or not ?

981


Is list a collection c#?

983


What can be done with c#?

833


What is the difference between static and constant variables?

1075


How do you create user defined data types in c#?

1009


What are delegates and why are they required?

987


What is difference between list and dictionary in c#?

886