InterviewSolution
Saved Bookmarks
| 1. |
Which concept of OOP is false for C++?(a) Code can be written without using classes(b) Code must contain at least one class(c) A class must have member functions(d) At least one object should be declared in codeThe question was asked in an online interview.This intriguing question comes from OOPs Basic Concepts in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» CORRECT option is (b) Code must CONTAIN at least one class Easiest explanation - In C++, it’s not necessary to use classes, and hence CODES can be written without using OOP concept. Classes MAY or may not contain member functions, so it’s not a necessary condition in C++. And, an object can only be declared in a code if its class is defined/included via header file. |
|