C++ Interview Question and Answers
46. |
Name some pure object oriented languages? |
|
- Smalltalk
- Java
- Eiffel
- Sather
|
|
|
47. |
What is encapsulation? |
|
Encapsulation (or information hiding) is the process of combining data and functions into a single unit called class. |
|
|
48. |
What is problem with Runtime type identification? |
|
The run time type identification comes at a cost of performance penalty. Compiler maintains the class. |
|
|
49. |
What are the differences between new and malloc? |
|
- New initializes the allocated memory by calling the constructor. Memory allocated with new should be released with delete.
- Malloc allocates uninitialized memory.
- The allocated memory has to be released with free.new automatically calls the constructor while malloc(dosen’t)
|
|
|
50. |
What is conversion operator? |
|
You can define a member function of a class, called a conversion function, that converts from the type of its class to another specified type. |
|
|