Oops Paper
Oops Paper
QUESTION
1 Which of the following is true about encapsulation in object-oriented programming?
2 What is inheritance in object-oriented programming?
3 What is polymorphism in object-oriented programming?
4 Which of the following statements is true about abstraction in object-oriented programming?
5 What is a constructor in object-oriented programming?
6 Who invented OOP?
7 Which is not a feature of OOP in general definitions?
8 Which was the first purely object oriented programming language developed?
9 When OOP concept did first came into picture?
10 Which feature of OOP indicates code reusability?
11 Which header file is required in C++ to use OOP?
12 Which among the following doesn’t come under OOP concept?
13 The feature by which one object can interact with another object is _____________
14 How many types of access specifiers are provided in OOP (C++)?
15 What is encapsulation in OOP?
16 Which of the following is not true about polymorphism?
17 What is an abstraction in object-oriented programming?
18 Which among the following can show polymorphism?
19 In which access should a constructor be defined, so that object of the class can be created in any function?
20 The copy constructors can be used to ________
21 Which among the following represents correct constructor?
22 What happens when an object is passed by reference?
23 Which access specifier is usually used for data members of a class?
24 How to access data members of a class?
25 Which feature of OOP reduces the use of nested classes?
26 Which keyword among the following can be used to declare an array of objects in java?
27 Which operator can be used to free the memory allocated for an object in C++?
28 Which of the following is not a property of an object?
29 Which type of members can’t be accessed in derived classes of a base class?
30 Single level inheritance supports _____________ inheritance.
31 Which keyword is used to declare virtual functions?
32 What happens if non static members are used in static member function?
33 What is friend member functions in C++?
34 Where is the memory allocated for the objects?
35 Encapsulation and abstraction differ as ____________
36 Which feature of OOP is exhibited by the function overriding?
37 How to access the private member function of a class?
38 Which is correct syntax for declaring pointer to object?
39 If data members are private, what can we do to access them from the class object?
40 Which among the following is not a necessary condition for constructors?
41 Object being passed to a copy constructor ___________
42 Instance of which type of class can’t be created?
43 ___________ underlines the feature of Polymorphism in a class.
44 Which feature in OOP is used to allocate additional functions to a predefined operator in any language?
45 Which feature can be implemented using encapsulation?
46 If the members have to be accessed from anywhere in the program and other packages also, which access specifi
47 Which among the following have least security according to the access permissions allowed?
48 How many public class(s) (outermost) can be there in a java program?
49 Which specifier can be used to inherit protected members as protected in subclass but public as public in subclass
50 In multi-level inheritance(all public), the public members of parent/superclass will ________
51 What is the additional feature in classes that was not in structures?
____ is considered to be a partitioned area of computer memory that stores and set of operations that can
52 access the data.
53 Which among the following best defines the abstract methods?
54 Which among the following is correct?
55 The abstract function definitions in derived classes is enforced at _________
56 Which of these specifiers would be applied to the constructors only?
57 The access specifier that is/are the most secure during inheritance is/are _______________.
58 A derived class is also called a ______________.
59 Hierarchical inheritance could be some subset of _________________ inheritance.
What is the name of the feature in which we enforce the definitions of the abstract function at the
60 compile time?
61 Which of these types of values result from a delete operator?
62 Which function is used to get any character that is present at a certain index of a string?
63 What is a delete operator?
64 Does delete return any value?
65 If delete is used to delete an object which was not allocated using new _______________
66 Delete operator _________________
67 Which is the correct syntax to delete an array of objects?
68 Which of the following type of class allows only one object of it to be created?
69 Which of the following is not a type of constructor?
70 Which of the following is not the member of class?
71 Which of the following concepts means determining at runtime what method to invoke?
72 Identify the scope resolution operator?
73 Which keyword should be used to declare static variables?
74 What do you call the languages that support classes but not polymorphism?
75 Which type of function among the following shows polymorphism?
76 Which among the following can’t be used for polymorphism?
77 How many types of member functions are generally there in C++?
78 What are inline member functions?
79 Static member functions _____________
80 Member function of a class can ____________
What is the name of the feature in which we enforce the definitions of the abstract function at the
compile time?
a. Dynamic Polymorphism
b. Static Polymorphism
c. Dynamic or Static Polymorphism according to need
d. Polymorphism
A
Encapsulation ensures data hiding and abstraction
The process of hiding the implementation details of an object
The ability of an object to take multiple forms
Abstraction ensures data hiding and inheritance
A method used to destroy objects
Andrea Ferro
Efficient Code
Kotlin
1980’s
Abstraction
OOP can be used without using any header file
Data hiding
Message reading
4
It is a way of combining various data members and member functions that operate on those data members into a single unit
Helps in redefining the same functionality
Hiding the implementation and showing only the features
Overloading &&
Any access specifier will work
Copy an object so that it can be passed to another primitive type variable
–classname()
Destructor is called at end of function
Protected
Dot, arrow or direct call
Inheritance
allocate
Unallocate
Properties
All can be accessed
Language independency
virt
Executes fine
Non-member functions which have access to all the members (including private) of a class
Cache
Hiding and hiding respectively
Polymorphism
Using class address
*className objectName;
Private data members can never be accessed from outside the class
Its name must be same as that of class
Must not be mentioned in parameter list
Parent class
Virtual Function
Function Overloading
Polymorphism
Public
Private
1
Private
Will continue to get inherited subsequently
Data members
Classes
Functions declared and defined in base class
Abstract functions should not be defined in all the derived classes
Runtime
a. Explicit
a. Protected
a. Small class
a. Multilevel
a. Dynamic Polymorphism
a. null
a. char charIn(StringName);
Deallocates a block of memory
Yes, positive value
Then out of memory error arises
Can be used on pointers with null value
delete [] objectName;
Virtual class
Copy constructor
Static function
Data hiding
#
const
Class based language
Inline function
Static member functions
2
Member functions which can be called without object
Contains “this” pointer for data members
Access all the members of the class
B
Encapsulation is used to achieve inheritance
The process of creating new classes using existing classes
The process of hiding the implementation details of an object
Abstraction is not related to data hiding
A method used to copy objects
Adele Goldberg
Code reusability
SmallTalk
1995
Polymorphism
stdlib.h
Message passing
Message Passing
3
It is a way of combining various data members and member functions into a single unit which can operate on any data
Increases overhead of function definition always
Hiding the important data
Overloading <<
Private
Copy an object for type casting
classname()
Destructor is called when called explicitly
Private
Dot operator
Binding
arr
Free()
Names
Protected
Multiple inheritance
virtually
Compile time error
Member function which doesn’t have access to private members
ROM
Binding and Hiding respectively
Encapsulation
Using object of class
className* objectName;
Create public member functions to access those data members
It must not have any return type
Must be passed with integer type
Abstract class
Inline function
Function Overriding
Overloading
Private
Default
2
Default
Will not be inherited after one subclass inheritance
Member functions
Objects
Functions only declared in base class
Abstract functions should be defined only in one derived class
Compile time
b. Implicit
b. Private
b. Subclass
b. Single level
b. Static Polymorphism
b. null pointer
b. char charAt(index);
Deallocates whole program memory
Yes, negative value
Then unreachable code error arises
Can be used on pointers with void value
delete * objectName;
Abstract class
Friend constructor
Friend function
Dynamic Typing
()
common
Procedure Oriented language
Virtual function
Member functions overloading
3
Member functions whose definition is expanded in place of its call
Contains “this” pointer if used for member functions
Access only Public members of the class
Which among the following have least security according to the access permissions allowed?
a) Private
Default
c) Protected
d) Public
1. ____ is considered to be a partitioned area of computer memory that stores and set of operations that
can access the data.
C
Encapsulation is not related to data hiding
The process of making data and methods private within a class
The process of creating multiple instances of a class
Abstraction hides the implementation details of an object and only shows the necessary features
A special method used to initialize objects
Alan Kay
Modularity
Java
1970’s
Encapsulation
iostream.h
Platform independent
Data transfer
2
It is a way of combining various data members into a single unit
It is feature of OOP
Hiding the implementation
Overloading ||
Public
Copy an object so that it can be passed to a function
()classname
Destructor is not called
Public
Arrow operator
Abstraction
new
Collect
Identity
Private
Compile time
virtual
Executes if that member function is not used
Member function which can modify any data of a class
HDD
Hiding and Binding respectively
Abstraction
Using object pointer
className objectName();
Create private member functions to access those data members
It must contain a definition body
Must be passed by value
Anonymous class
Enclosing class
Operator Overloading
Inheritance
Protected
Protected
3
Public
Will not be available to be called outside class
Static data allowed
Variables
Function which may or may not be defined in base class
Abstract functions must be defined in base class
Writing code time
c. Protected
c. Private and Default
c. Noticeable class
c. Multiple
Functions B
Function which must be declared in derived class B
Abstract functions must be defined in all the derived classes D
Interpreting time B
d. Public A
d. Default B
d. Big class B
d. Hybrid D
d. Polymorphism A
d. void D
d. char charAt(StringName); B
Deallocates all the data reserved for a class A
No D
Then undefined variable error arises C
Can be used on pointer with any value C
delete objectName[]; A
Friend class C
Parameterized constructor B
Virtual function C
Dynamic loading C
&& C
stat C
If classes are supported, polymorphism will always be supported C
Class member functions B
Constructor overloading A
5 D
Member function which is defined in single line B
Doesn’t contain “this” pointer if member functions are referred C
Access subclass members A
Objects are the variables of the type ____?
A. String
B. Boolean
C. Class
D. All data types can be included
SR.NO. QUESTION A B C D Answer
Which among the following have least security according to the access permissions allowed?
a) Private
b) Default
c) Protected
Objects
are the
variables
of the
d) Public type ____?
A. String
B.
Boolean
C. Class
D. All
data
types
can be
included
1. ____ is
considere
d to be a
partition
ed area
of
computer
memory
that
stores
and set
of
operation
s that can
access
the data.
What is the name
of the feature in
which we enforce
the definitions of
the abstract
function at the
compile time?
a. Dynamic
Polymorphism
b. Static
Polymorphism
c. Dynamic or
Static
Polymorphism
according to need
d. Polymorphism
any function?
the access permissions allowed?
Which
function is
Which of used to
these get any
types of character
values that is
result present at
from a a certain
delete index of a
operator? string? What is a delete operator? Does delete return any value?
a. char
charIn(Str
ingName)
a. null ; a) Deallocates a block of memory a) Yes, positive value
b. char
b. null charAt(ind
pointer ex); b) Deallocates whole program memory b) Yes, negative value
c. char
c. void charIn(ind
pointer ex); c) Deallocates only primitive data memory c) Yes, zero value
d. char
charAt(Str
ingName)
d. void ; d) Deallocates all the data reserved for a class d) No
Delete operator _________________ Which is the correct syntax to delete an array of objects?
a) Can be used on pointers with null value a) delete [] objectName;
c) Object-based language