What things would you remember while making an interface?



What things would you remember while making an interface?..

Answer / Manjula

When creating an interface in C++, remember to:
1. Define pure virtual functions (functions without implementation).
2. Use abstract classes (classes with at least one pure virtual function).
3. Make sure the derived classes implement all the pure virtual functions.
4. Keep interfaces independent of implementations.
5. Make interfaces easy to extend and difficult to modify.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

what are the iterator and generic algorithms.

1 Answers  


sizeof- is it functioning statically or dynamically?

2 Answers  


What is decltype c++?

1 Answers  


What is the difference between the indirection operator and the address of oper-ator?

1 Answers  


What C++ libraries are you proficient with?

1 Answers   Google,


How many ways are there to initialize an int with a constant?

1 Answers  


What is the difference between new/delete and malloc/free?

1 Answers  


when can we use copy constructor?

6 Answers   HP,


Assume an array of structure is in order by studentID field of the record, where student IDs go from 101 to 500. Write the most efficient pseudocode algorithm you can to find the record with a specific studentID if every single student ID from 101 to 500 is used and the array has 400 elements. Write the most efficient pseudocode algorithm you can to find a record with a studentID near the end of the IDs, say in the range from 450 to 500, if not every single student ID in the range of 101 to 500 is used and the array size is only 300

1 Answers  


What is low level language in simple words?

1 Answers  


What is enum class in c++?

1 Answers  


A milk carton can hold 3.78 litres of milk. Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost of producing one litre of milk is $0.38, and the profit of each carton of milk is $0.27. Write a C++ program that prompts the user to enter the total amount of milk produced in the morning. Then display the number of milk cartons needed to hold milk, the cost of producing milk, and the profit for producing milk.

2 Answers  


Categories