In which cases you use override and new base?

Answers were Sorted based on User's Feedback



In which cases you use override and new base?..

Answer / naveen goud

It is used to ovveride superclass method.Suppose in super
calss we had a method getEmployee() in the subclass am
overriding it and am giving the new implementation.Means am
just giving new implementation instead of using the same
implementation.

Is This Answer Correct ?    0 Yes 0 No

In which cases you use override and new base?..

Answer / swetcha

Use the new modifier to explicitly hide a member inherited
from a base class. To hide an inherited member, declare it
in the derived class using the same name, and modify it
with the new modifier.

Is This Answer Correct ?    2 Yes 3 No

Post New Answer

More OOPS Interview Questions

What does I oop mean?

1 Answers  


what are the different types of qualifier in java?

1 Answers   TCS,


What is Iteration Hierarchy? What is what is Object behavioral concept?

1 Answers  


What is multilevel inheritance in oop?

1 Answers  


how many types of notations are in java

1 Answers   National University of Modern Languages (NUML),


Write a program to find out the number of palindromes in a sentence.

1 Answers   TCS,


what is virtual function?

26 Answers   Aspire, HP, Infosys, RoboSoft, TCS,


what is the advantage in software? what is the difference between the software developer and Engineer

1 Answers  


WHAT IS THE ACTUAL DEFINATION OF OBJECT AND THE CLASS IN ONE SINGLE LINE WHICH THE INTERVIEWER WANT TO LISTEN.

11 Answers  


Why a "operator=(...)" when there is a copy ctor?

2 Answers  


i had specified the access specifier for abstarct class member like (pure virtual function) as private.But it can be accessed by the derived class.How the private member of one class is accessed by other class.if any body face this problem and found the solution plz reply to me.

1 Answers   Syntel,


What is polymorphism and example?

1 Answers  


Categories