0% found this document useful (0 votes)
71 views18 pages

Grug 6

The document contains multiple choice questions about object-oriented programming concepts in C++ such as classes, inheritance, polymorphism, encapsulation, and more. It also includes questions about the Turbo C++ and Visual Studio integrated development environments.

Uploaded by

Grunesh Karande
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views18 pages

Grug 6

The document contains multiple choice questions about object-oriented programming concepts in C++ such as classes, inheritance, polymorphism, encapsulation, and more. It also includes questions about the Turbo C++ and Visual Studio integrated development environments.

Uploaded by

Grunesh Karande
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Which of the following type of class allows only one object of it to be

created?
Question
Virtual class
Abstract class
Singleton class
Friend class
Which of the following is not a type of constructor?
Question
Copy constructor
Friend constructor
Default constructor
Parameterized constructor
Which of the following statements is correct?
Question
Base class pointer cannot point to derived class.
Derived class pointer cannot point to base class.
Pointer to derived class cannot be created.
Pointer to base class cannot be created.
Which of the following is not the member of class?
Question
Static function
Friend function
Const function
Virtual function
Which of the following concepts means determining at runtime what
method to invoke?
Question
Data hiding
Dynamic Typing
Dynamic binding
Dynamic loading
Which of the following term is used for a function defined inside a class?
Question
Member Variable
Member function
Class function
Classic function
Which of the following concept of oops allows compiler to insert
arguments in a function call if it is not specified?
Question
Call by value
Call by reference
Default arguments
Call by pointer
How many instances of an abstract class can be created?
Question
1
5
13
0
Which of the following cannot be friend?
Question
Function
Class
Object
Operator function
Which of the following concepts of OOPS means exposing only necessary
information to client?
Question
Encapsulation
Abstraction
Data hiding
Data binding
Why reference is not same as a pointer?
Question
A reference can never be null.
A reference once established cannot be changed.
Reference doesn't need an explicit dereferencing mechanism.
All of the above.
Cout is a/an __________ ?
Question
operator
function
object
macro
Which of the following concepts provides facility of using object of one
class inside another class?
Question
Encapsulation
Abstraction
Composition
Inheritance
How many types of polymorphisms are supported by C++?
Question
1
2
3
4
Which of the following is an abstract data type?
Question
int
double
string
Class
Which of the following concepts means adding new components to a
program as it runs?
Question
Data hiding
Dynamic typing
Dynamic binding
Dynamic loading
Which of the following statement is correct?
Question
A constructor is called at the time of declaration of an object.
A constructor is called at the time of use of an object.
A constructor is called at the time of declaration of a class.
A constructor is called at the time of use of a class.
Which of the following correctly describes overloading of functions?
Question
Virtual polymorphism
Transient polymorphism
Ad-hoc polymorphism
Pseudo polymorphism
In Turbo C++ which of the following command is used to open a new file?
Question
Press Alt + F, N
Press Alt + F5, N
Press Alt + F9, N
Press Alt + F3, N
In Turbo C++ which of the following command is used to save the current
file?
Question
Press F9
Press F5
Press F3
Press F2
In Turbo C++ which of the following command is used to compile and run
the program?
Question
Press Ctrl + F2
Press Ctrl + F9
Press Ctrl + F5
Press Ctrl + F4
In Turbo C++ which of the following command is used to view the output
of the program?
Question
Press Alt + F5
Press Alt + F4
Press Alt + F2
Press Alt + F9
In Turbo C++ which of the following command is used to close the
currently opened file?
Question
Press Alt + F5
Press Alt + F3
Press Alt + F9
Press Alt + F2
In Turbo C++ which of the following command is used to exit Turbo C+
+?
Question
Press Alt + Z
Press Alt + A
Press Alt + X
Press Alt + C
In Visual Studio C++, which of the following command is used to
Compile and execute the program?
Question
Press Ctrl + F5
Press Ctrl + F4
Press Ctrl + F9
Press Ctrl + F3
C++ programs are converted into machine language with the help of?
Question
An Editor
A Compiler
An operating system
A Programmer
Which of the command prompt is used to change the directory?
Question
AB
BC
CD
DC
Which of the following command is used to execute a program using gcc
compiler?
Question

Which of the following is correct about class and structure?


Question
class can have member functions while structure cannot.
class data members are public by default while that of structure are private.
Pointer to structure or classes cannot be declared.
class data members are private by default while that of structure are public by
default.
Which of the following concepts means wrapping up of data and functions
together?
Question
Abstraction
Encapsulation
Inheritance
Polymorphism
Which of the following concepts means waiting until runtime to determine
which function to call?
Question
Data hiding
Dynamic casting
Dynamic binding
Dynamic loading
How "Late binding" is implemented in C++?
Question
Using C++ tables
Using Virtual tables
Using Indexed virtual tables
Using polymorphic tables
Which of the following operator is overloaded for object cout?
Question
>>
<<
+
=
Which of the following is the correct class of the object cout?
Question
iostream
istream
ostream
ifstream
Which of the following cannot be used with the keyword virtual?
Question
class
member functions
constructor
destructor
Which of the following functions are performed by a constructor?
Question
Construct a new class
Construct a new object
Construct a new function
Initialize objects
Which of the following problem causes an exception?
Question
Missing semicolon in statement in main().
A problem in calling function.
A syntax error.
A run-time error.
Which one of the following options is correct about the statement given
below?
The compiler checks the type of reference in the object and not the type of
object.
Question
Inheritance
Polymorphism
Abstraction
Encapsulation
Which of the following is the correct way of declaring a function as
constant?
Question
const int ShowData(void) { /* statements */ }
int const ShowData(void) { /* statements */ }
int ShowData(void) const { /* statements */ }
int (void) const { /* statements */ }
Which of the following concepts is used to implement late binding?
Question
Virtual function
Operator function
Const function
Static function
Which of the following statement is correct?
Question
C++ allows static type checking.
C++ allows dynamic type checking.
C++ allows static member function be of type const.
C++ allows both static type checking as well as dynamic type checking.
Which of the following factors supports the statement that reusability is a
desirable feature of a language?
Question
It decreases the testing time.
It lowers the maintenance cost.
It reduces the compilation time.
It decreases the testing time and also lowers the maintenance cost.
Which of the following ways are legal to access a class data member using
this pointer?
Question
this->x
this.x
*this.x
*this-x
Which of the following is a mechanism of static polymorphism?
Question
Operator overloading
Function overloading
Templates
All of the above
What happens if the base and derived class contains definition of a
function with same prototype?
Question
Compiler reports an error on compilation.
Only base class function will get called irrespective of object.
Only derived class function will get called irrespective of object.
Base class object will call base class function and derived class object will call
derived class function.
Which of the following are available only in the class hierarchy chain?
Question
Public data members
Private data members
Protected data members
Member functions
Which operator is having right to left associativity in the following?
Question
Array subscripting
Function call
Addition and subtraction
Type cast
Which operator is having the highest precedence?
Question
postfix
unary
shift
equality
What is the use of dynamic_cast operator?
Question
It converts virtual base class to derived class.
it converts virtual base object to derived objects.
It will convert the operator based on precedence.
It will convert the object based on its declaration.
Where does the execution of the program starts?
Question
user-defined function
main function
void function
friend function
What are mandatory parts in function declaration?
Question
return type, function name
return type, function name, parameters
parameters, function name
parameters, return type
Which of the following is used to terminate the function declaration?
Question
Colon (:)
Closing bracket ())
Semicolon (;)
Comma (,)
What is the scope of the variable declared in the user defined function?
Question
whole program
only inside the {} block
main function
outside of the function
How many types of returning values are present in c++?
Question
1
2
3
4
What will you use if you are not intended to get a return value?
Question
static
const
volatile
void
Where does the return statement returns the execution of the program?
Question
main function
caller function
same function
friend function
How many ways of passing a parameter are there in c++?
Question
1
2
3
4
Which is used to keep the call by reference value as intact?
Question
static
const
absolute
int
By default how the value are passed in c++?
Question
call by value
call by reference
call by pointer
call by variable
Which of the following permits function overloading on c++?
Question
type
number of arguments
type & number of arguments
neither type nor arguments
In which of the following we cannot overload the function?
Question
return function
caller
called function
friend function
Function overloading is also similar to which of the following?
Question
operator overloading
constructor overloading
destructor overloading
pointer overloading
Which header file is used to pass unknown number of arguments to
function?
Question
stdlib.h
string.h
stdarg.h
stdio.h
How can you access the arguments that are manipulated in the function?
Question
va_list
arg_list
both va_list & arg_list
reference variable
To which does the function pointer point to?
Question
variable
constants
function
absolute variables
What we will not do with function pointers?
Question
allocation of memory
de-allocation of memory
both allocation & de-allocation of memory
function encapsulation
What are the mandatory part to present in function pointers?
Question
&
return values
data types
&&
Which of the following can be passed in function pointers?
Question
variables
data types
functions
pointers
Which operator is used to signify the namespace?
Question
conditional operator
ternary operator
scope operator
bit wise operator
Identify the correct statement.
Question
Namespace is used to group class, objects and functions.
Namespace is used to mark the beginning of the program.
Namespace is used to separate the class, objects.
Namespace is used to declare class, objects and functions.
How many specifiers are present in access specifiers in class?
Question
1
2
3
4
How many specifiers are present in access specifiers in class?
Question
1
2
3
4
Which is used to define the member of a class externally?
Question
:
::
#
All of the above
Which other keywords are also used to declare the class other than class?
Question
struct
union
object
both struct & union
Which of the following is a valid class declaration?
Question
class A { int x; };
class B { }
public class A { }
object A { int x; };
The fields in the class in C++ program are by default:
Question
protected
private
public
Can be public or protected
Constructors are used to?
Question
initialize the objects
construct the data members
both initialize the objects & construct the data members
All of the above
When struct is used instead of the keyword class, what will happen in the
program?
Question
access is public by default
access is private by default
access is protected by default
access is secured by default
Where does the object gets created?
Question
class
constructor
destructor
attributes
How to access the object in the class?
Question
Scope resolution operator
ternary operator
direct member access operator
All of the above
Which of these following members are not accessed by using direct
member access operator?
Question
Public
private
protected
both private & protected
Operator overloading is?
Question
making c++ operator works with objects
giving new meaning to existing operator
making new operator
adding operation to the existing operators
What is the use of function call operator?
Question
overloading the methods
overloading the objects
overloading the parameters
All of the above
Pick out the correct statement.
Question
virtual functions does not give the ability to write a templated function
virtual functions does not give the ability to rewrite a templated function
virtual functions does give the ability to write a templated function
virtual functions does give the ability to rewrite a templated function
What will happen when the function call operator is overloaded?
Question
It will not modify the functions
It will modify the functions
It will modify the object
It will modify the operator to be interpreted
How to store the large objects in C++, if it extents its allocated memory?
Question
memory heap
stack
queue
tree
When we are using heap operations what do we need to do to save the
memory?
Question
rename the objects
delete the objects after processing
both rename & delete the objects
either rename or delete the objects
Which container in C++ will take large objects?
Question
string
class
vector
stack
Which is used to allocate and deallocate storage for objects during the
execution?
Question
Stack
Heap
Free store
Data
Which operators are used in the free store?
Question
new
delete
both new & delete
Bitwise OR
What type of class member is operator new?
Question
static
dynamic
const
smart
What must be an operand of operator delete?
Question
Pointer
Array
Stack
Queue
Which of the following is used to allocate an object outside the object
lifetime?
Question
int
float
void*
char*
How many items are there in sequence container?
Question
2
3
4
5
Which of the following class templates are based on arrays?
Question
vector
list
dequeue
Both vector & dequeue
Which of the following will return the new element at the end of
container?
Question
front
back
push_back
pop_back
How the list containers are implemented?
Question
Using Double linked list
Using Single linked list
Using Single & Double linked list
Using Stack and Queue
Which of the following does not support any insertion or deletion?
Question
Array
Vector
Dequeue
List
What do container adapter provide to interface?
Question
Restricted interface
More interface
No interface
Graphics interface
What does the sequence adaptor provide?
Question
Insertion
Deletion
Interface to sequence container
Updation

You might also like