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 dependency injection in simple words?

868


What is a console in c#?

806


Can we inherit sealed class in c#?

824


What is difference between array and collection?

971


Is multilevel inheritance possible in c#?

848


What are the differences between value types and reference types?

1040


What are c# i/o classes? What are the commonly used i/o classes?

872


What is getenumerator?

803


What is default value of bool in c#?

904


Does the system.exception class have any cool features?

945


What is difference between array and collection in c#?

835


What is the real use of interface in c#?

865


Hi to all..I have to create an intranet application on C#.NET windows Application so please please let can you people help me as iam new in .NET and if u have any samples or website address from where i can get sample please let know.

4165


What is assembly version series sequence?

940


can multiple catch blocks be executed for a single try statement?

927