| Other OOPS Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| suppose A is a base class and B is the derved class. Both
have a method foo which is defined as a virtual method in
the base class. You have a pointer of classs B and you
typecast it to A. Now when you call pointer->foo, which
method gets called?
The next part of the question is, how does the compiler
know which method to call? | EA-Electronic-Arts | 2 |
| What is the output of the following code:
int v()
{
int m=0;
return m++;
}
int main()
{
cout<<v();
}
1) 1
2) 0
3) Code cannot compile
| | 3 |
| What is abstraction? | | 6 |
| how to swap to variables without using thrid variable in java? | | 3 |
| What will happen when the following code is run:
int x;
while(x<100)
{
cout<<x;
x++;
}
1) The computer will output "0123...99"
2) The computer will output "0123...100"
3) The output is undefined
| | 3 |
| What is a linked list?
| IBM | 4 |
| Base class has two public data members. How can i derive a
new class with one datamember as public and another data
member as private?. | | 2 |
| Why do we use virtual functions? | | 3 |
| What is Object and Class? What are the differences between
them? | | 3 |
| what is object slicing?
| Wipro | 4 |
| Explain the concept of abstracion and encapsulation with
one example. What is the difference between them? | PCS | 2 |
| When is a memory allocated to a class? | | 3 |
| if u write a class do u write Assignment operator and copy
constructor | Siemens | 1 |
| What is the difference between an object and a class? | | 2 |
| How is data security provided in Object Oriented languages?
? | | 3 |
| what is the use of mutable key word | HCL | 2 |
| What is polymorphism? Explain with an example. | | 7 |
| what is virtual function in c++ | | 4 |
| what is the basic concept of inheritance? | | 3 |
| what is the usage of clas templates | | 5 |
| |
| For more OOPS Interview Questions Click Here |