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

wht is major diff b/w c and c++?

10 Answers  


Generally, in all C++ programs, texts are in white colour. Can we change the colour of the text(either input or output or both)? If so, help me out.

1 Answers  


what is the difference between <stdio.h>and "stdio.h"?

5 Answers  


given a set based questions and 5 questions based on it next data sufficiciency questions 2 and 2/3 english sentence completion with options very easy and 2 synononmys paragraph with 10 questions 10 minutes replace =,-,*,% with -,%,+,* type questions 5 3 questions lik following itssickhere itssickthere itssickhere istsickhere which is nt alike the others very easy

0 Answers   DELL,


why the argument is passed by reference to a copy constructor?example?

2 Answers  






What does oop mean in snapchat?

0 Answers  


which structured data type is not used in c++? 1.union 2.structure 3.string 4.boolean

2 Answers   HCL, Wipro,


INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?

0 Answers  


There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.

0 Answers  


What is a class in oop?

0 Answers  


Why is polymorphism needed?

0 Answers  


Describe what an Interface is and how it?s different from a Class.

7 Answers   Spinsys,


Categories