0% found this document useful (0 votes)
14 views

OOPS Questions

Uploaded by

shobit98200
Copyright
© © All Rights Reserved
Available Formats
Download as XLS, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

OOPS Questions

Uploaded by

shobit98200
Copyright
© © All Rights Reserved
Available Formats
Download as XLS, PDF, TXT or read online on Scribd
You are on page 1/ 12

S.

No Question Text Choice A Choice B Choice C


What are the major Abstraction, Encapsulation Hierarchy, concurrency Abstraction,
elements in an object and persistence and typing encapsulation and
1 model? hierarchy
Which of the following is Abstraction of data Abstraction of function Abstraction of structure
not a type of object
oriented abstraction?

2
A pure virtual function or 0 1
pure virtual method is a
virtual function that is
required to be
implemented by a derived
class that is abstract.

3
Wrapping up of data & Overloading Data Abstraction Polymorphism
functions together in a
class is known as _____.

4
Including only necessary Overloading Data Abstraction Polymorphism
details and ignoring
additional details while
defining a class is known
as ____.

5
Preventing direct access of Polymorphism Inheritance Data Hiding
data-members of the class
from outside world is
known as ____.
6
State the object oriented C++ Java Eiffel
languages

7
What is a reference? an operator a reference is an alias for used to rename an object
an object

8
A library function exit() the loop in which it occurs the block in which it occurs the function in which it
causes an exit from occurs
9
In Object-oriented classes & objects functions structures
programming, the
problem is divided into
_____.
10
A class is ____ datatype. primitive derived user-defined
11
A class is a collection of data-members & member data-members, member data-members, member
____ and _____. functions functions and functions,
main() main() and include
statements
12
An object is …… a variable of class same as a class. just like a global variable
datatype
13
In OOPS unit of data is Bits Blocks Structures
14 called as
There is no difference 0 1
between an object and an
15 instance.State true or false
A pure virtual function or 0 1
pure virtual method is a
virtual function that is
required to be
implemented by a derived
class that is abstract.

16
Creating a new class using Polymorphism Encapsulation overloading
one or more existing
classes is known as ____.
17
Ability of an operator or Polymorphism Encapsulation overloading
function call to take
different forms is known
as ____.
18
If a class C is derived from protected and public data protected and public data private data in A and B.
class B, which is derived only in C and B. only in C
from class A, all through
public inheritance, then a
class C member function
can access

19
RunTime Polymorphism is friend function virtual function operator overloading
achieved by ______
20
Which of the statements is Private members of the Protected members of the Public members of the
true in a protected base class become base class become public base class become
derivation of a derived protected members of the members of the derived protected members of the
class from a base class? derived class class derived class

21
Mechanism of deriving a Polymorphism Single Inheritance Multilevel Inheritance
class from another derived
class is known as____
22
Which of the following Only existing operators Overloaded operator must The overloaded operators
statements is NOT valid can be overloaded. have at least one operand follow the syntax rules of
about operator of its class type. the original operator.
overloading?
23
Which of the following is class d : public b1, public class d : class b1, class b2 class d : public b1, b2
the valid class declaration b2
header for the derived
class d with base
classes b1 and b2?

24
A class defined within Nested class Inheritance Containership
another class is:
25
The major goal of To facilitate the conversion To help modular To extend the capabilities
inheritance in c++ is: of data types. programming. of a class

26
The following can be an object a class a public data member
declared as friend in a
class
27
Which of the following -> () equal to
operator can be
overloaded through friend
function?
28
A class cannot inherit 1 0
members from more than
one class. (State whether
true or false)
29
By default, all members of Public Protected No access
a class have ___________
access for all its members
30
Functions can be declared 1 0
with default values in
parameters. We use
default keyword to specify
the value of such
parameters
State whether the
statement is true or false

31
Overloaded functions Very long functions that One function containing Two or more functions
are can hardly run another one or more with the same name
functions inside it. but different number of
parameters or type.
32
Identify the correct Global variables are Local variables are Global variables are
statement regarding scope declared in a separate declared inside a declared inside a
of variables file and accessible from function and function and accessible
any program. accessible within the from anywhere in
33 function only. program.
You can use C++ as a 1 0
procedural, as well as an
object-oriented, language
34
When the compiler overloaded destructed ambiguous
cannot differentiate
between two overloaded
constructors, they are
called
35
To be called object- Overloading polymorphism inheritance
oriented, a programming
language must allow
which of the following
36 features
Header files in C++ .H .HE .HEA
often have the file
37 extension _____
When a child class class of the object immediate ancestor base class
function is called, the using the function class
compiler looks first for a name
matching function name
38 in the _____
Paying attention to the selectiveness polymorphism abstraction
important properties while
ignoring inessential details
is known as
39
A base class may also child class subclass derived class
40 be called a
Which of the following Base class pointer Derived class pointer Pointer to derived class
statements is correct? cannot point to derived cannot point to base cannot be created.
41 class. class.
Which of the following is Static function Friend function Const function
not the member of
42 class?
How many instances of 1 5 13
an abstract class can be
43 created?
Which of the following Encapsulation Abstraction Data hiding
concepts of OOPS
means exposing only
necessary information to
44 client?
Which of the following is Operator overloading Namespaces Inheritance
not a feature of C++ ?
45
Overloading the function requires a class with requires a class with an allows you to create
operator an overloaded overloaded [ ] operator. objects that act
operator. syntactically like
46 functions.
How many access 1 2 3
specifiers are present in C+
+ programming class?
47
Which of the following is a class A { int x; }; class B { } class B { }
valid class declaration?

48
Over Overload void
To overload an operator
_____________keyword
must be used along with
the operator to be
overloaded.
49
When an object has many Scalability Inheritence Polymorphism
forms, it has _____.

50
By polymorphism of a it should be reusable it should have it should accept
subsystem we mean polymorphic data types generic commands
and interpret
51 appropriately
All objects have i, ii, iii ii, iii, iv i, iii, iv
(i) attributes
(ii) states
(iii)a set of operations
(iv) a unique identity
52
Which of the following Scope resolution operator Equality operator Assignment Operator
operator can not be
53 overloaded ?
Which of the following C++ allows static type C++ allows dynamic C++ allows static
statement is correct? checking. type checking. member function be of
54 type const.
Which of the following this->x this.x *this.x
ways are legal to access a
class data member using
this pointer?
55
Which special character is ; : #
used to mark the end of
class?
56
Procedure oriented Structured programming Object oriented Functional programming
57 Programs are called as programming
A __________ is an class object loop
abstract idea that can be
represented with data
structures and functions.
58
Automatic Initialization of friend casting reference parameter
object is carried out using
a special member function
called
____________________
59
In C++ a class can allow private protected Friend
non-member functions
and other classes to access
its own private data, by
making them as
_________________.
60
In c++ ___________ Scope resolution Conditional New
Operator is used for
Dynamic memory
allocation
61
The advantages of OOP 1& 3 1& 2 3& 4
are ,
1. increased programming
productivity
2. decreased maintenance
costs.
3. less time to execute
4. easy to understand

62
State True or False 1-F, 2-F 1-F, 2-T 1-T, 2-T
1. Public data members
can be accessed directly in
the main function without
an object.
2. Constructors can be
overloaded.
63
Choice D
Typing

Abstraction of name

Encapsulation

Encapsulation

scope resolution.

All of the above

None of these

the program in which it


occurs
modules

All of these

None of these

collection of data-
members alone

Targets

inheritance

inheritance

protected data in A and B

function overloading

Protected derivation does


not affect private and
protected members of the
derived class.
Message Passing

none of the above.

class d : b1, b2

Encapsulation

To hide the details of base


class.

a private data member

private
None of the listed
options

Local variables are


declared in the function
that can be accessible
outside from any other
functions.

dubious

All of the above

.HEAD

descendant class

summarizing

parent class

Pointer to base class


cannot be created.

Virtual function

0
Data binding

Reflection

usually make use of a


constructor that takes
arguments.

object A { int x; };

Operator

Encapsulation

None of the listed options

i, ii, iii, iv

None of the listed options

None of the listed


options
*this-x

None of the listed options

data type

constructor.

public

Membership access

2& 3

1-T, 2-F

You might also like