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 technical or oop name of object?

1 Answers  


What is abstraction and encapsulation?

0 Answers  


difference between overloading and overridding

11 Answers  


Which is the best institute in hyderabad for C/C++ and it also has fast track course structure.

13 Answers   Wipro,


What are the advantanges of modularity

2 Answers  






where is memory for struct allocated? where is memory for class-object allocated? I replied for struct in stack and for class-object in heap. THen he asked if class has struct member variable what happens.class on heap and what about struct in that class? couldnt ans :( :-?

2 Answers   Infosys, Microsoft,


What are main features of oop?

0 Answers  


pointers are support in C#? if yes then how to use it?

8 Answers   Softvision Solution,


Can we create object of abstract class?

0 Answers  


What is the point of polymorphism?

0 Answers  


Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.

0 Answers  


Difference between realloc() and free?

9 Answers   HP,


Categories