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 is the types of inheritance?

0 Answers  


what is an qt4 interface?

1 Answers   IBM,


write knight tour problem which is present in datastructure

0 Answers  


What is friend function?

12 Answers   Wipro,


What is difference between multiple inheritance and multilevel inheritance?

0 Answers  






difference between structure and union.

2 Answers   ADP, Convergys,


What is polymorphism and types?

0 Answers  


what is the difference between class and object?

9 Answers  


what is object slicing

3 Answers   TCS,


Why interface is used?

0 Answers  


difference between static and non-static variables?

2 Answers  


c++ is a pure object oriented programming or not?

5 Answers   Wipro,


Categories