Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Which was the first purely object oriented programming language developed?(a) Java(b) C++(c) SmallTalk(d) KotlinI got this question in my homework.Question is taken from OOPs Basic Concepts topic in chapter OOPs Concept & Features of Object Oriented Programming

Answer» RIGHT option is (c) SmallTalk

The BEST I can explain: SmallTalk was the first PROGRAMMING language DEVELOPED which was purely object oriented. It was developed by Alan Kay. OOP concept came into the picture in 1970’s.
2.

Which of the following best defines a class?(a) Parent of an object(b) Instance of an object(c) Blueprint of an object(d) Scope of an objectThis question was addressed to me in an international level competition.The origin of the question is OOPs Basic Concepts topic in division OOPs Concept & Features of Object Oriented Programming

Answer» RIGHT OPTION is (c) BLUEPRINT of an object

For explanation: A class is Blueprint of an object which describes/ shows all the functions and data that are provided by an object of a specific class. It can’t be CALLED as parent or instance of an object. Class in general describes all the PROPERTIES of an object.
3.

What is the additional feature in classes that was not in structures?(a) Data members(b) Member functions(c) Static data allowed(d) Public access specifierI have been asked this question during an interview for a job.My doubt is from OOPs Basic Concepts in division OOPs Concept & Features of Object Oriented Programming

Answer»

Right OPTION is (B) Member functions

To explain I WOULD say: Member functions are allowed inside a class but were not present in structure concept.DATA members, static data and public access specifiers were present in STRUCTURES too.

4.

Who invented OOP?(a) Alan Kay(b) Andrea Ferro(c) Dennis Ritchie(d) Adele GoldbergThe question was asked by my college professor while I was bunking the class.This is a very interesting question from OOPs Basic Concepts in section OOPs Concept & Features of Object Oriented Programming

Answer» CORRECT answer is (a) ALAN Kay

The best I can explain: Alan Kay invented OOP, Andrea FERRO was a part of SMALLTALK Development. Dennis invented C++ and Adele Goldberg was in team to DEVELOP SmallTalk but Alan actually had got rewarded for OOP.
5.

Which is not feature of OOP in general definitions?(a) Code reusability(b) Modularity(c) Duplicate/Redundant data(d) Efficient CodeThe question was posed to me in semester exam.I need to ask this question from OOPs Basic Concepts in division OOPs Concept & Features of Object Oriented Programming

Answer»

Right answer is (C) Duplicate/Redundant data

To explain: Duplicate/Redundant data is dependent on programmer and hence can’t be guaranteed by OOP. Code reusability is done using INHERITANCE. Modularity is supported by using different code files and classes. Codes are more EFFICIENT because of FEATURES of OOP.

6.

Pure OOP can be implemented without using class in a program. (True or False)(a) True(b) FalseThe question was asked by my school teacher while I was bunking the class.My question comes from OOPs Basic Concepts topic in section OOPs Concept & Features of Object Oriented Programming

Answer»

Correct choice is (b) FALSE

For explanation: It’s false because for a program to be PURE OO, everything must be WRITTEN inside CLASSES. If this rule is VIOLATED, the program can’t be labelled as purely OO.

7.

When OOP concept did first came into picture?(a) 1970’s(b) 1980’s(c) 1993(d) 1995I had been asked this question in my homework.This interesting question is from OOPs Basic Concepts topic in division OOPs Concept & Features of Object Oriented Programming

Answer»

Correct choice is (a) 1970’s

To EXPLAIN I would say: OOP first came into picture in 1970’s by ALAN and his TEAM. Later it was used by some programming languages and got implemented successfully, SmallTalk was first language to use PURE OOP and FOLLOWED all rules strictly.

8.

Which Feature of OOP illustrated the code reusability?(a) Polymorphism(b) Abstraction(c) Encapsulation(d) InheritanceI got this question in an online quiz.This key question is from OOPs Basic Concepts in chapter OOPs Concept & Features of Object Oriented Programming

Answer»

Right answer is (d) Inheritance

The explanation is: USING inheritance we can reuse the code already written and ALSO can avoid creation of MANY new functions or VARIABLES, as that can be done one time and be REUSED, using classes.

9.

Which language does not support all 4 types of inheritance?(a) C++(b) Java(c) Kotlin(d) Small TalkThis question was addressed to me by my school principal while I was bunking the class.I want to ask this question from OOPs Basic Concepts in section OOPs Concept & Features of Object Oriented Programming

Answer»

Right option is (b) Java

The BEST EXPLANATION: Java doesn’t support all 4 types of inheritance. It doesn’t support MULTIPLE inheritance. But the multiple inheritance can be IMPLEMENTED using interfaces in Java.

10.

How many classes can be defined in a single program?(a) Only 1(b) Only 100(c) Only 999(d) As many as you wantI had been asked this question in quiz.Question is taken from OOPs Basic Concepts topic in portion OOPs Concept & Features of Object Oriented Programming

Answer»

Correct choice is (d) As MANY as you want

The best EXPLANATION: Any NUMBER of classes can be DEFINED inside a program, provided that their names are different. In java, if public class is PRESENT then it must have the same name as that of file.

11.

Why Java is Partially OOP language?(a) It supports usual declaration of primitive data types(b) It doesn’t support all types of inheritance(c) It allows code to be written outside classes(d) It does not support pointersThe question was asked during an interview.The doubt is from OOPs Basic Concepts in portion OOPs Concept & Features of Object Oriented Programming

Answer»

Right option is (a) It supports usual DECLARATION of primitive data types

Easiest explanation - As JAVA supports usual declaration of data VARIABLES, it is partial implementation of OOP. Because ACCORDING to rules of OOP, object CONSTRUCTORS must be used, even for declaration of variables.

12.

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.
13.

Which header file is required in C++ to use OOP?(a) iostream.h(b) stdio.h(c) stdlib.h(d) OOP can be used without using any header fileThis question was posed to me in exam.This question is from OOPs Basic Concepts topic in division OOPs Concept & Features of Object Oriented Programming

Answer»

Right option is (d) OOP can be used without using any header FILE

The explanation: We NEED not include any specific header file to use OOP concept in C++, only specific functions used in code need their RESPECTIVE header files to be included or classes should be DEFINED if needed.

14.

Which feature allows open recursion, among the following?(a) Use of this pointer(b) Use of pointers(c) Use of pass by value(d) Use of parameterized constructorI got this question by my school principal while I was bunking the class.My question is based upon OOPs Basic Concepts in division OOPs Concept & Features of Object Oriented Programming

Answer»

The CORRECT CHOICE is (a) Use of this pointer

For explanation: Use of this pointer allows an object to call data and methods of itself whenever NEEDED. This helps US call the members of an object recursively, and differentiate the variables of different scopes.

15.

Which of the two features match each other?(a) Inheritance and Encapsulation(b) Encapsulation and Polymorphism(c) Encapsulation and Abstraction(d) Abstraction and PolymorphismI have been asked this question in an interview for internship.This intriguing question originated from OOPs Basic Concepts topic in section OOPs Concept & Features of Object Oriented Programming

Answer»

The CORRECT choice is (c) Encapsulation and Abstraction

Easy explanation - Encapsulation and Abstraction are similar features. Encapsulation is ACTUALLY binding all the properties in a single class or we can say hiding all the features of object inside a class. And Abstraction is hiding unwanted data (for user) and SHOWING only the data REQUIRED by the user of PROGRAM.

16.

Which of the following is not type of class?(a) Abstract Class(b) Final Class(c) Start Class(d) String ClassI got this question during an interview for a job.My doubt stems from Classes topic in portion OOPs Concept & Features of Object Oriented Programming

Answer»

The correct option is (c) START Class

The best explanation: Only 9 TYPES of classes are provided in general, namely, abstract, final, mutable, wrapper, anonymous, input-output, string, system, network. We MAY further divide the classes into PARENT class and SUBCLASS if inheritance is used.

17.

Class is pass by _______(a) Value(b) Reference(c) Value or Reference, depending on program(d) CopyI had been asked this question by my school teacher while I was bunking the class.My doubt is from Classes in portion OOPs Concept & Features of Object Oriented Programming

Answer» RIGHT CHOICE is (b) REFERENCE

Explanation: Classes are PASS by reference, and the structures are pass by copy. It doesn’t depend on the PROGRAM.
18.

What is default access specifier for data members or member functions declared within a class without any specifier, in C++?(a) Private(b) Protected(c) Public(d) Depends on compilerI got this question in my homework.This intriguing question originated from Classes in chapter OOPs Concept & Features of Object Oriented Programming

Answer»

Right answer is (a) Private

Easiest explanation - The DATA members and MEMBER FUNCTIONS are Private by default in C++ classes, if NONE of the access specifier is used. It is actually made to increase the PRIVACY of data.

19.

Which is known as a generic class?(a) Abstract class(b) Final class(c) Template class(d) Efficient CodeThe question was asked in an interview.My doubt stems from Classes topic in section OOPs Concept & Features of Object Oriented Programming

Answer» CORRECT option is (c) Template class

To explain: Template classes are known to be generic classes because those can be used for any data TYPE value and the same class can be used for all the variables of DIFFERENT data types.
20.

Size of a class is _____________(a) Sum of the size of all the variables declared inside the class(b) Sum of the size of all the variables along with inherited variables in the class(c) Size of the largest size of variable(d) Classes doesn’t have any sizeI have been asked this question during an online interview.The origin of the question is Classes in division OOPs Concept & Features of Object Oriented Programming

Answer» RIGHT option is (d) CLASSES doesn’t have any size

The explanation is: Classes doesn’t have any size, actually the size of object of the CLASS can be defined. That is done only when an object is created and its constructor is called.
21.

Which class can have member functions without their implementation?(a) Default class(b) String class(c) Template class(d) Abstract classThe question was asked in my homework.I want to ask this question from Classes topic in section OOPs Concept & Features of Object Oriented Programming

Answer»

Right option is (d) Abstract class

The explanation is: Abstract classes can have MEMBER functions with no implementation, where the inheriting SUBCLASSES must implement those functions.

22.

Which of the following describes a friend class?(a) Friend class can access all the private members of the class, of which it is a friend(b) Friend class can only access protected members of the class, of which it is a friend(c) Friend class don’t have any implementation(d) Friend class can’t access any data member of another class but can use it’s methodsI got this question during an online interview.I'm obligated to ask this question of Classes in portion OOPs Concept & Features of Object Oriented Programming

Answer» RIGHT answer is (a) FRIEND class can access all the private members of the class, of which it is a friend

The explanation: A friend class can access all the private members of another class, of which it is a friend. It is a SPECIAL class provided to use when you need to reuse the data of a class but don’t WANT that class to have those special functions.
23.

What is the scope of a class nested inside another class?(a) Protected scope(b) Private scope(c) Global scope(d) Depends on access specifier and inheritance usedI got this question by my college director while I was bunking the class.My question is taken from Classes topic in section OOPs Concept & Features of Object Oriented Programming

Answer»

The correct ANSWER is (d) Depends on access specifier and inheritance USED

To explain I would SAY: It depends on the access specifier and the type of inheritance used with the class, because if the class is inherited then the nested class can be used by subclass too, provided it’s not of private type.

24.

Class with main() function can be inherited.(a) True(b) FalseThe question was asked in class test.This intriguing question comes from Classes in division OOPs Concept & Features of Object Oriented Programming

Answer»

Correct option is (a) True

Easy explanation - The CLASS containing main function can be INHERITED and HENCE the PROGRAM can be executed using the derived class names also in java.

25.

Which among the following is false, for a member function of a class?(a) All member functions must be defined(b) Member functions can be defined inside or outside the class body(c) Member functions need not be declared inside the class definition(d) Member functions can be made friend to another class using the friend keywordThe question was posed to me in homework.This key question is from Classes topic in portion OOPs Concept & Features of Object Oriented Programming

Answer»

The correct answer is (C) MEMBER functions NEED not be declared inside the class definition

To explain I would say: Member functions must be declared inside class body, though the definition can be GIVEN OUTSIDE the class body. There is no way to declare the member functions outside the class.

26.

Which syntax for class definition is wrong?(a) class student{ };(b) student class{ };(c) class student{ public: student(int a){ } };(d) class student{ student(int a){} };I had been asked this question in exam.Question is from Classes topic in section OOPs Concept & Features of Object Oriented Programming

Answer»

Right choice is (b) student class{ };

The best explanation: KEYWORD class should COME first. Class NAME should come after keyword class. PARAMETERIZED constructor definition depends on programmer so it can be left EMPTY also.

27.

Which of the following pairs are similar?(a) Class and object(b) Class and structure(c) Structure and object(d) Structure and functionsI got this question by my college professor while I was bunking the class.The question is from Classes topic in section OOPs Concept & Features of Object Oriented Programming

Answer»

The CORRECT choice is (B) Class and structure

The BEST explanation: Class and structure are SIMILAR to each other. Only major difference is that a structure doesn’t have MEMBER functions whereas the class can have both data members and member functions.

28.

Which among the following is false for class features?(a) Classes may/may not have both data members and member functions(b) Class definition must be ended with a colon(c) Class can have only member functions with no data members(d) Class is similar to union and structuresThis question was addressed to me in an interview for internship.This question is from Classes in division OOPs Concept & Features of Object Oriented Programming

Answer» RIGHT choice is (b) Class DEFINITION MUST be ended with a colon

The best explanation: Class definition must END with a semicolon, not colon. Class can have only MEMBER functions in its body with no data members.
29.

Instance of which type of class can’t be created?(a) Anonymous class(b) Nested class(c) Parent class(d) Abstract classI got this question in an interview for internship.My doubt stems from Classes topic in section OOPs Concept & Features of Object Oriented Programming

Answer»

Correct choice is (d) Abstract class

Easy explanation - INSTANCE of abstract class can’t be CREATED as it will not have any constructor of its own, hence while CREATING an instance of class, it can’t initialize the object members. Actually the class INHERITING the abstract class can have its instance because it will have implementation of all members.

30.

Which definition best describes an object?(a) Instance of a class(b) Instance of itself(c) Child of a class(d) Overview of a classThis question was posed to me in an online quiz.Asked question is from Objects topic in portion OOPs Concept & Features of Object Oriented Programming

Answer»

The correct answer is (a) Instance of a class

Easy explanation - An object is instance of its class. It can be declared in the same WAY that a variable is declared, only THING is you have to USE class name as the DATA type.

31.

How many objects can be declared of a specific class in a single program?(a) 32768(b) 127(c) 1(d) As many as you wantThe question was posed to me in an online interview.This interesting question is from Objects in portion OOPs Concept & Features of Object Oriented Programming

Answer»

Right answer is (d) As MANY as you want

The best explanation: You can create as many OBJECTS of a specific class as you want, provided enough MEMORY is AVAILABLE.

32.

Which among the following is false?(a) Object must be created before using members of a class(b) Memory for an object is allocated only after its constructor is called(c) Objects can’t be passed by reference(d) Objects size depends on its class data membersThis question was posed to me in an international level competition.This interesting question is from Objects topic in division OOPs Concept & Features of Object Oriented Programming

Answer»

Right choice is (c) Objects can’t be passed by REFERENCE

To explain I would say: Objects can be passed by reference. Objects can be passed by value ALSO. If the object of a CLASS is not created, we can’t USE members of that class.

33.

Which of the following is incorrect?(a) class student{}s;(b) class student{};student s;(c) class student{}s[];(d) class student{}; student s[5];The question was posed to me in an international level competition.I'd like to ask this question from Objects in division OOPs Concept & Features of Object Oriented Programming

Answer»

Right ANSWER is (C) class student{}s[];

The explanation is: The array must be specified with a size. You can’t declare object array, or any other LINEAR array without specifying its size. It’s a MANDATORY field.

34.

The object can’t be __________(a) Passed by reference(b) Passed by value(c) Passed by copy(d) Passed as functionThis question was addressed to me in final exam.My question is based upon Objects topic in section OOPs Concept & Features of Object Oriented Programming

Answer»

The correct option is (d) Passed as function

To EXPLAIN: Object can’t be passed as function as it is an instance of some CLASS, it’s not a function. Object can be passed by reference, VALUE or copy. There is no term defined as PASS as function for objects.

35.

Functions can’t return objects.(a) True(b) FalseI had been asked this question during an interview.My doubt is from Objects in portion OOPs Concept & Features of Object Oriented Programming

Answer»

The correct answer is (b) False

To EXPLAIN: Functions can always return an OBJECT if the return type is same as that of object being RETURNED. Care has to be taken while writing the PROTOTYPE of the function.

36.

How members of an object are accessed?(a) Using dot operator/period symbol(b) Using scope resolution operator(c) Using member names directly(d) Using pointer onlyThis question was posed to me by my school teacher while I was bunking the class.This key question is from Objects topic in portion OOPs Concept & Features of Object Oriented Programming

Answer»

Right option is (a) Using dot OPERATOR/period symbol

Explanation: Using dot operator after the NAME of object we can access its MEMBERS. It is not necessary to use the pointers. We can’t use the names directly because it may be USED outside the class.

37.

If a local class is defined in a function, which of the following is true for an object of that class?(a) Object is accessible outside the function(b) Object can be declared inside any other function(c) Object can be used to call other class members(d) Object can be used/accessed/declared locally in that functionThis question was addressed to me in examination.This interesting question is from Objects in section OOPs Concept & Features of Object Oriented Programming

Answer» RIGHT option is (d) Object can be used/accessed/declared locally in that function

Explanation: For an object which belongs to a LOCAL class, it is MANDATORY to DECLARE and use the object WITHIN the function because the class is accessible locally within the class only.
38.

Which among the following is wrong?(a) class student{}; student s;(b) abstract class student{}; student s;(c) abstract class student{}s[50000000];(d) abstract class student{}; class toppers: public student{}; topper t;The question was posed to me by my college professor while I was bunking the class.This intriguing question originated from Objects in portion OOPs Concept & Features of Object Oriented Programming

Answer»

Correct CHOICE is (b) ABSTRACT class student{}; student s;

For explanation: We can never CREATE instance of an abstract class. Abstract classes doesn’t have constructors and hence when an instance is CREATED there is no facility to initialize its members. Option d is correct because topper class is inheriting the base abstract class student, and hence topper class object can be created easily.

39.

When an object is returned___________(a) A temporary object is created to return the value(b) The same object used in function is used to return the value(c) The Object can be returned without creation of temporary object(d) Object are returned implicitly, we can’t say how it happens inside programThe question was asked in semester exam.I'm obligated to ask this question of Objects topic in chapter OOPs Concept & Features of Object Oriented Programming

Answer»

Correct choice is (a) A TEMPORARY object is CREATED to return the value

The explanation: A temporary object is created to return the value. It is created because the object used in function is destroyed as SOON as the function is returned. The temporary variable returns the value and then gets destroyed.

40.

Object declared in main() function _____________(a) Can be used by any other function(b) Can be used by main() function of any other program(c) Can’t be used by any other function(d) Can be accessed using scope resolution operatorThis question was posed to me in homework.My enquiry is from Objects topic in section OOPs Concept & Features of Object Oriented Programming

Answer»

Right choice is (C) Can’t be used by any other function

For explanation: The OBJECT declared in main() have local scope inside main() function only. It can’t be used OUTSIDE main() function. Scope RESOLUTION operator is used to access GLOBALLY declared variables/objects.

41.

Object can’t be used with pointers because they belong to user defined class, and compiler can’t decide the type of data may be used inside the class.(a) True(b) FalseI had been asked this question by my college professor while I was bunking the class.Enquiry is from Objects topic in portion OOPs Concept & Features of Object Oriented Programming

Answer»

Correct answer is (B) False

For explanation: The explanation given is wrong because OBJECT can always be used with pointers like with any other VARIABLES. Compiler doesn’t have to KNOW the structure of the class to use a pointer because the pointers only POINTS to a memory address/stores that address.

42.

Which among the following is correct?(a) class student{}s1,s2; s1.student()=s2.student();(b) class student{}s1; class topper{}t1; s1=t1;(c) class student{}s1,s2; s1=s2;(d) class student{}s1; class topper{}t1; s1.student()=s2.topper();The question was asked in examination.The query is from Objects in section OOPs Concept & Features of Object Oriented Programming

Answer»

The correct CHOICE is (c) class student{}S1,S2; s1=s2;

The best explanation: Only if the objects are of same class then their data can be copied from to another using assignment OPERATOR. This actually comes under operator OVERLOADING. Class constructors can’t be assigned any explicit value as in option class student{}s1; class topper{}t1; s1=t1; and class student{}s1; class topper{}t1; s1.student()=s2.topper();.

43.

Which feature of OOP indicates code reusability?(a) Encapsulation(b) Inheritance(c) Abstraction(d) PolymorphismThe question was asked in an interview for internship.Query is from OOPs Features topic in section OOPs Concept & Features of Object Oriented Programming

Answer»

Correct option is (b) Inheritance

Easy EXPLANATION - Inheritance indicates the code reusability. Encapsulation and ABSTRACTION are meant to hide/group data into one element. POLYMORPHISM is to INDICATE different tasks performed by a single entity.

44.

Which of the following is not a feature of pure OOP?(a) Classes must be used(b) Inheritance(c) Data may/may not be declared using object(d) Functions OverloadingI got this question by my college director while I was bunking the class.My query is from OOPs Features in portion OOPs Concept & Features of Object Oriented Programming

Answer»

The correct answer is (C) Data may/may not be declared using object

The best I can EXPLAIN: Data must be declared using objects. Object usage is mandatory because it in turn calls its constructors, which in turn must have a class DEFINED. If object is not USED, it is a violation of pure OOP CONCEPT.

45.

If a function can perform more than 1 type of tasks, where the function name remains same, which feature of OOP is used here?(a) Encapsulation(b) Inheritance(c) Polymorphism(d) AbstractionThis question was addressed to me during an interview for a job.My question is from OOPs Features topic in section OOPs Concept & Features of Object Oriented Programming

Answer»

The correct option is (c) Polymorphism

Easy explanation - For the feature given above, the OOP feature used is Polymorphism. EXAMPLE of polymorphism in REAL life is a kid, who can be a student, a SON, a BROTHER depending on where he is.

46.

If different properties and functions of a real world entity is grouped or embedded into a single element, what is it called in OOP language?(a) Inheritance(b) Polymorphism(c) Abstraction(d) EncapsulationThis question was posed to me during an online interview.My doubt is from OOPs Features in portion OOPs Concept & Features of Object Oriented Programming

Answer» RIGHT choice is (d) Encapsulation

Explanation: It is Encapsulation, which groups different properties and functions of a REAL WORLD entity into single ELEMENT. Abstraction, on other hand, is hiding of functional or exact WORKING of codes and showing only the things which are required by the user.
47.

Which among the following doesn’t come under OOP concept?(a) Platform independent(b) Data binding(c) Message passing(d) Data hidingI had been asked this question by my school teacher while I was bunking the class.My question is from OOPs Features in division OOPs Concept & Features of Object Oriented Programming

Answer»

Correct CHOICE is (a) PLATFORM independent

The BEST explanation: Platform INDEPENDENCE is not feature of OOP. C++ supports OOP but it’s not a platform independent language. Platform independence depends on programming language.

48.

How many basic features of OOP are required for a programming language to be purely OOP?(a) 7(b) 6(c) 5(d) 4The question was asked in homework.My question is from OOPs Features topic in section OOPs Concept & Features of Object Oriented Programming

Answer»

Right choice is (a) 7

Easy explanation - There are 7 basic features that define WHETHER a programing language is pure OOP or not. The 4 basic features are inheritance, polymorphism, encapsulation and abstraction. Further, ONE is, object use is must, SECONDLY, MESSAGE passing and lastly, Dynamic binding.

49.

The feature by which one object can interact with another object is _____________(a) Data transfer(b) Data Binding(c) Message Passing(d) Message readingThe question was posed to me during an online exam.I'm obligated to ask this question of OOPs Features topic in division OOPs Concept & Features of Object Oriented Programming

Answer»

The CORRECT choice is (C) Message Passing

The best explanation: The interaction between two object is called the message passing feature. Data TRANSFER is not a feature of OOP. Also, message reading is not a feature of OOP.

50.

Which feature may be violated if we don’t use classes in a program?(a) Inheritance can’t be implemented(b) Object must be used is violated(c) Encapsulation only is violated(d) Basically all the features of OOP gets violatedThis question was posed to me in an internship interview.Asked question is from OOPs Features in chapter OOPs Concept & Features of Object Oriented Programming

Answer»

Correct CHOICE is (d) Basically all the features of OOP gets violated

The BEST I can explain: All the features are violated because INHERITANCE and ENCAPSULATION won’t be implemented. Polymorphism and Abstraction are still possible in some cases, but the main features like DATA binding, object use and etc won’t be used hence the use of class is must for OOP concept.