Discussion
Which concept allows different functions with the same name in C++ ?
Answer: B
The concept is function overloading.
Function overloading lets several functions share one name as long as their parameter lists differ in number or type, for example area(int) for a square and area(int, int) for a rectangle. The compiler picks the right one from the arguments at each call, which makes it a form of compile-time polymorphism.
Encapsulation bundles data with the functions that act on it. Inheritance lets a class derive members from another class. Data hiding restricts access to a class's internals with private and protected members. None of these allows two functions with the same name.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development