Object Oriented Programming Solved MCQs - Part 2

It is possible to declare as a friend A member function A global function A class All of the above       _____________________...


It is possible to declare as a friend

A member function
A global function
A class
All of the above
      _____________________________________________________________________________________
What will be the result of the expression 13 & 25?

38
25
9
12
      _____________________________________________________________________________________
A function call mechanism that passes arguments to a function by passing a copy of the values of the arguments is __________

Call by name
Call by value
Call by reference
Call by value result
      _____________________________________________________________________________________
The members of a class, by default, are

Public
Protected
Private
Mandatory to specify
      _____________________________________________________________________________________
Which of the following is a string literal constant?

“Visual C++”
“137.45”
“A”
All of the above
      _____________________________________________________________________________________
Which of the following statements is NOT valid about operator overloading? 

Only existing operators can be overloaded
Overloaded operator must have at least one operand of its class type
The overloaded operators follow the syntax rules of the original operator
None of the above
      _____________________________________________________________________________________
What is the output of the following code
char symbol[3]={‘a’,‘b’,‘c’};
for (int index=0; index<3; index++)
cout << symbol [index];


a b c
“abc”
abc
‘abc’
      _____________________________________________________________________________________
Which of the statements is true in a protected derivation of a derived class from a base class?

Private members of the base class become protected members of the derived class
Protected members of the base class become public members of the derived class
Public members of the base class become protected members of the derived class
Protected derivation does not affect private and protected members of the derived class
      _____________________________________________________________________________________
In which case is it mandatory to provide a destructor in a class? 

Almost in every class
Class for which two or more than two objects will be created
Class for which copy constructor is defined
Class whose objects will be created dynamically
      _____________________________________________________________________________________
The concept of hierarchical classification is related to

Abstraction
Inheritance
Function overloading
None
      _____________________________________________________________________________________

Assume that we have constructor function for both Base and Derived classes. Now consider the declaration :

main ( )
Base *p = new Derived;
In what sequence, the constructor will be executed ?


Derived class constructor is followed by Base class constructor.
Base class constructor is followed by Derived class constructor.
Base class constructor is never called.
Derived class constructor is never called.
      _____________________________________________________________________________________
If you wanted to sort many large objects or structures, it would be most efficient to 

Place them in an array and sort the array.
Place pointers to them in an array and sort the array.
Place them in a linked list and sort the linked list.
Place references to them in an array and sort the array.
      _____________________________________________________________________________________
cfront

is the front end of a C compiler
is the per-process of a C compiler
is a tool that is translated a C++ code to its equivalent C code
None of above
      _____________________________________________________________________________________
Usually a pure virtual function 

Has complete function body
Will never be called
Will be called only to delete an object
Is defined only in derived class
      _____________________________________________________________________________________
A static data member is given a value

Within the class definition
Outside the class definition
When the program is exeuted
Never
      _____________________________________________________________________________________
C++ was originally developed by

Clocksin and Melish
Donald E.Knuth
Sir Richard Hadlee
Bjarne Stroustrup
      _____________________________________________________________________________________
What is the error in the following code?
class t
{
virtual void print();
}


No error
Function print() should be declared as static.
Function print() should be defined.
Class t should contain data members.
      _____________________________________________________________________________________
If a class C is derived from class B, which is derived from class A, all through public inheritance, then a class C member function can access

Protected and public data only in C and B
Protected and public data only in C
Private data in A and B
Protected data in A and B
      _____________________________________________________________________________________
A friend function has access to all private and protected members of the class for which it is a friend 

Only private
Private and protected
Only protected
None of the above
      _____________________________________________________________________________________
Which of the following cannot be legitimately passed to a function 

A constant
A variable
A structure
A header file
      _____________________________________________________________________________________
Match the following :
(a) Garbage collection in     1. Java
(b) Nameless object             2. generic programming
(c) Template support            3. defines a class
(d) A forward reference       4. member function
(e) Derived class inherits
from base class 


1   5   4   2   3
1   5   2   3   4
5   1   2   3   4
5   4   3   1   2
      _____________________________________________________________________________________
The polymorphism can be characterized by the phrase

One interface,multiple methods
Multiple interfaces,one method
One interface,one method
None of the above
      _____________________________________________________________________________________
A class defined within another class is 

Nested class
Inheritance
Containership
Encapsulation
      _____________________________________________________________________________________
In multiple inheritance 

The base classes must have only default constructors
Cannot have virtual functions
Cannot have virtual classes
None of the above
      _____________________________________________________________________________________
Which of the statements are true ?
I. Function overloading is done at compile time.
II. Protected members are accessible to the member of derived class.
III. A derived class inherits constructors and destructors.
IV. A friend function can be called like a normal function.
V. Nested class is a derived class.


I, II, III
II, III, V
III, IV, V
I, II, IV
      _____________________________________________________________________________________
In C++, dynamic memory allocation is accomplished with the operator ____

new
this
malloc( )
delete
      _____________________________________________________________________________________
Use of virtual functions implies

Overloading
Overriding
Static binding
Dynamic binding
      _____________________________________________________________________________________
Which of the following type casts will convert an Integer variable named amount to a Double type?

(double) amount
(int to double) amount
int to double(amount)
int (amount) to double
      _____________________________________________________________________________________
The members of a class by default are 

Public
Protected
Private
Mandatory to specify
      _____________________________________________________________________________________
 What will be the output of following program?
#include<iostream.h>
void main()
{
float x;
x=(float)9/2;
cout<<x;
}


4.5
4.0
4
5
      _____________________________________________________________________________________
Which feature in OOP allows reusing code?

Polymorphism
Inheritance
Encapsulation
Data hiding
      _____________________________________________________________________________________
Exception handling is targeted at

Run-time error
Compile time error
Logical error
All of the above
      _____________________________________________________________________________________
Overloading a postfix increment operator by means of a member function takes 

No argument
One argument
Two arguments
Three arguments
      _____________________________________________________________________________________
Which of the following, if any, are valid names for variables?

class
friend
void
None of the above is valid names for variables
      _____________________________________________________________________________________
What does C++ append to the end of a string literal constant?

a space
a number sign (#)
an asterisk (*)
a null character
      _____________________________________________________________________________________
A template class 

Is designed to be stored in different containers
Works with different data types
Generates objects which must be identical
Generates classes with different numbers of member functions
      _____________________________________________________________________________________
A struct is the same as a class except that

There are no member functions
All members are public
Cannot be used in inheritance hierarchy
It does have a this pointer
      _____________________________________________________________________________________
An array element is accessed using

a first-in-first-out approach
the dot operator
a member name
an index number
      _____________________________________________________________________________________
Which of the following is not the characteristic of constructor? 

They should be declared in the public section.
They do not have return type.
They can not be inherited.
They can be virtual.
      _____________________________________________________________________________________
An exception is caused by 

A hardware problem
A problem in the operating system
A syntax error
A run-time error
      _____________________________________________________________________________________
To access the public function fbase() in the base class, a statement in a derived class function fder() uses the statement.fbase();

fbase();
fder();
base::fbase();
der::fder();
      _____________________________________________________________________________________
RunTime Polymorphism is achieved by ______ 

Friend function
Virtual function
Operator overloading
Function overloading
      _____________________________________________________________________________________
Runtime polymorphism is achieved by

Friend function
Virtual function
Operator overloading
Function overloading
      _____________________________________________________________________________________
Pure virtual functions 

Have to be redefined in the inherited class
Cannot have public access specification
Are mandatory for a virtual class
None of the above
      _____________________________________________________________________________________
If x =5, y =2 then x ^y equals________.
(where ^ is a bitwise XOR operator)


00000111
10000010
10100000
11001000
      _____________________________________________________________________________________
Identify the operator that is NOT used with pointers

->
&
*
>>
      _____________________________________________________________________________________
A friend function to a class, C cannot access 

Private data members and member functions
Public data members and member functions
Protected data members and member functions
The data members of the derived class of C
      _____________________________________________________________________________________
A variable defined within a block is visible 

From the point of definition onward in the program
From the point of definition onward in the function
From the point of definition onward in the block
Throughout the function
      _____________________________________________________________________________________
The function whose prototype is void getData(Item *thing); receives

a pointer to a structure
a reference to a structure
a copy of a structure
nothing
      _____________________________________________________________________________________
The keyword friend does not appear in 

The class allowing access to another class
The class desiring access to another class
The private section of a class
The public section of a class
      _____________________________________________________________________________________

TECH$type=three$author=hide

Name

5G Technology,1,Abbreviations,2,Agent AI,1,Agentic Ai,1,AI in Education,1,AI in Healthcare,1,AI in surgery,1,AI Reasoning,1,Algorithm,1,Algorithms,4,android,2,Artemis Mission,1,Artificial Intelligence,5,Artificial Intelligence AI,2,Artificial Neural Networks,1,ASCI and UNI),1,Augmented Reality,1,Automata,3,Blockchain,1,Blockchain Technology,1,C Language,2,C Programming,1,c#,1,C++,2,C++ Programming,1,CakePhp,1,Carbon Neutrality,1,CCNA,1,Cellular Communication,1,Chatgpt,1,Cloud Computing,4,Compiler Construction,1,Compiler Construction Solved MCQs,1,Compiler Design,1,Computer,18,Computer Applications,1,Computer Architecture,3,Computer Arithmetics,1,Computer Basics,1,Computer Codes (BCD,1,Computer Fundamentals,5,Computer Graphics,4,Computer Networking,2,Computer Networks,4,Computer Organization,1,Computer Science,2,Computer Short Cut Keys,1,Computer Short Keys,1,CPU Sceduling,1,Cryptocurrency,1,CSS,1,CSS PMS,1,Current Trends and Technologies,1,Custom Hardware,1,Cyber Security,6,Cybercrimes,1,DALL-E,1,Data Communication,1,Data Privacy,1,Data structures,3,Database Management System,4,DBMS,4,Deadlock,1,DeepSeek,1,Digital Systems,1,Digital Systems Solved MCQs - Part 2,1,Discrete Mathematics,2,Discrete Structure,1,dot Net,1,EBCDIC,1,Edge Computing,2,English,1,Ethical AI and Bias,1,Ethics,1,Explainable AI (XAI),1,File System,1,Flowcharts,1,General Data Protection Regulation GDPR,1,General Knowledge,1,Generative AI,2,Gig Economy,1,Graphics Designing,1,Helping Materials,1,HTML,1,HTML 5,1,hybrid work model,1,Inference Optimization,1,Information Systems,1,Information Technology,1,Inpage,1,intelligence,1,Internet,1,Internet Basics,1,Internet of Things,1,Internet of things IOT,2,IT,1,JavaScript,1,jQuery,1,Language,11,Languages Processor,1,Languge,1,Li-Fi,1,Linux/Unix,2,Magento,1,Memory Management,1,Microprocessor,1,Microsoft PowerPoint,1,MidJourney,1,mindfulness apps,1,MS Access,1,MS DOS,1,MS Excel,1,MS Word,2,Multimodal AI,1,NASA,1,Number System,1,Object Oriented Programming (OOP),1,Object Oriented Programming(OOP),1,Operating System,9,Operating System Basics,1,oracle,2,Others,1,Pakistan,1,PCS,1,PHP,1,PMS,1,Process Management,2,Programming,3,Programming Languages,1,Python,2,python language,1,Quantitative Aptitude,2,Quantum Computing,2,R Programming,1,Ransomware,1,Robotic Process Automation RPA,1,Robotics,2,Ruby Language,1,search engine optimization,1,Semester III,2,seo,1,Sloved MCQs on Microsoft Power Point - updated,1,Software Engineering,3,Solved MCQs of MS Access - Updated,1,Solved MCQs on Computer Fundamentals,1,SpaceX Starship,1,SQL,1,System Analysis and Design,1,Theory of Computation,1,Trends and Technologies,1,Virtual Reality,1,web,1,web Fundamental,1,Web Technologies,2,Web3,1,WEB3 Technology,1,x8086,1,zoology,1,
ltr
item
COMPUTER SCIENCE SOLVED MCQS: Object Oriented Programming Solved MCQs - Part 2
Object Oriented Programming Solved MCQs - Part 2
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxxCKJD43EoJWzNqx63O9OLYrmJuR-AtepjUU4VTpfwTQg2t4VggS7jxomnKITU91EW_De8-tps5Ozl-_aDOmKMR1LQvX0vZuD4z4WPy0LE8A6P8u1dVF84Os1e3lItvxPyC1W_ivPnpM/s1600/14.jpg
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxxCKJD43EoJWzNqx63O9OLYrmJuR-AtepjUU4VTpfwTQg2t4VggS7jxomnKITU91EW_De8-tps5Ozl-_aDOmKMR1LQvX0vZuD4z4WPy0LE8A6P8u1dVF84Os1e3lItvxPyC1W_ivPnpM/s72-c/14.jpg
COMPUTER SCIENCE SOLVED MCQS
https://cs-mcqs.blogspot.com/2014/07/object-oriented-programming-solved-mcqs.html
https://cs-mcqs.blogspot.com/
https://cs-mcqs.blogspot.com/
https://cs-mcqs.blogspot.com/2014/07/object-oriented-programming-solved-mcqs.html
true
1616963833964386058
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content