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

Will I be able to get a picture in D drive to the c++ program? If so, help me out?

0 Answers  


Write an operator overloading program to write S3+=S2.

2 Answers  


what is the difference between a package and a software?

3 Answers  


how many types of notations are in java

1 Answers   National University of Modern Languages (NUML),


write a program which best describes polymorphism in real world?

2 Answers   CTS, Infosys, NexGen,






Write A Program using Single and Multiple Inheritance.

1 Answers  


What is difference between abstraction and encapsulation?

0 Answers  


features of OOPS

22 Answers   Ness Technologies, Satyam,


Difference between new operator and operator new

2 Answers  


Explain the advantages of inheritance.

0 Answers   TCS,


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 class and example?

0 Answers  


Categories