Technical Interview Questions and Answers :: Sapient
- Select All
- SQL
- Java
- C++
- Informatica
- Operating System
- Soft. Engineering
- DBMS
- C
- HR Question in TR
- Data Structure
- HTML
- PHP
11 / 70
No Discussion on this question yet!
12 / 70
Single entity showing multiple behaviours.
Example: Mobile can be used to take photos , internet usage,text documents creation etc.,
Two types of polymorphism 1.static polymorphism ( method over riding)
2. Dynamic polymorphism ( method over loading)
13 / 70
When an object is sent a message then it does not know itself what type it is, the runtime environment will decide about function calling over an object. This feature of connecting an object with its associated message at runtime is known as Polymorphism or Late binding or Dynamic binding.
14 / 70
When a method is declared as abstract/virtual method in a base class and which is overridden in a base class. If we create a variable of a type of a base class and assign an object of a derived class to it, it will be decided at a run time, which implementation of a method is to be called.
This is known as Pure-Polymorphism or Late-Binding.
15 / 70
function overloading: instead of writing the different functions to perform same actions we write same function name with different number of parameters of different types of parameters it is called function overloading.
advantages of function overloading- improve code
16 / 70
Function overloading
17 / 70
Function overloading: C++ enables several functions of the same name to be defined, as long as these functions have different sets of parameters (at least as far as their types are concerned). This capability is called function overloading. When an overloaded function is called, the C++ compiler elects the proper function by examining the number, types and order of the arguments in the call. Function overloading is commonly used to create several functions of the same name that perform similar tasks but on different data types.
Operator overloading allows existing C++ operators to be redefined so that they work on objects of user-defined classes. Overloaded operators are syntactic sugar for equivalent function calls. They form a pleasant facade that doesn't add anything fundamental to the language (but they can improve understand ability and reduce maintenance costs).
18 / 70
When there is more than one constructor in a class with different parameters and with different data types we say that the constructor is overloaded.
19 / 70
No Discussion on this question yet!
20 / 70
A virtual function, equated to zero is called a pure virtual function. It is a function declared in a base class that has no definition related to the base class.
e.g.: virtual void display () =0;