0% found this document useful (0 votes)
4 views11 pages

C++ Object-Oriented Programming Quiz

The document is a C++ assignment from S P Sharma Classes, consisting of multiple-choice questions covering fundamental concepts of object-oriented programming, including classes, inheritance, encapsulation, and polymorphism. It addresses various topics such as constructors, destructors, access specifiers, and file I/O operations. The assignment serves as a study guide for students to test their understanding of C++ programming principles.

Uploaded by

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

C++ Object-Oriented Programming Quiz

The document is a C++ assignment from S P Sharma Classes, consisting of multiple-choice questions covering fundamental concepts of object-oriented programming, including classes, inheritance, encapsulation, and polymorphism. It addresses various topics such as constructors, destructors, access specifiers, and file I/O operations. The assignment serves as a study guide for students to test their understanding of C++ programming principles.

Uploaded by

bhavani.kanwar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

C++ Assignment S P SHARMA CLASSES [Link].

com

1.) The basic unit of object-oriented 8.) In object oriented programming, by


programming is a wrapping up characteristics and behaviour
A.) method into one unit, we achieve
B.) class A.) data abstraction
C.) overloading B.) data encapsulation
D.) object C.) data hiding
D.) All of the above
2.) Classes in C++ are .....
A.) derived data types 9.) The major goal of object oriented
B.) user defined data types programming is
C.) built-in data types A.) top-down program development
D.) All of the above B.) speed
C.) user interface
3.) Reusability of the code can be achieved D.) reuse
in C++ through
A.) polymorphism 10.) The mechanism by which the data and
B.) encapsulation functions are bound together with an
C.) inheritance object definition.
D.) Both (A) and (C) A.) Inheritance
B.) Encapsulation
4.) The entire set of data and code of an C.) Abstraction
object can be made a user defined data D.) Polymorphism
type with the help of .....
A.) object 11.) Which of the following operators can
B.) class be overloaded in C++?
C.) binding A.) Scope resolution operator
D.) abstraction B.) sizeof operator
C.) Conditional operator
5.) Paying attention to the important D.) Arithmetic operator
properties while ignoring inessential
details is known as 12.) Overloading involves writing two or
A.) selectiveness more functions with .....
B.) polymorphism A.) different names and different argument
C.) abstraction lists
D.) summarising B.) different names and the same argument
list
6.) ..... refers to the act of representing C.) the same name and different argument
only essential features without including lists
the background details. D.) the same name and the same argument
A.) Data hiding list
B.) Data encapsulation
C.) Data abstraction 13.) In C++, overloaded functions
D.) All of the above A.) are the group of functions with the
same name
7.) The classes which are intended for the B.) all have the same name and type of
creation of objects or instances, are called arguments
...... C.) may fall unexpectedly due to stress
A.) abstract class D.) All of the above
B.) concrete class
C.) binding 14.) By default, members of the class are
D.) polymorphism ..... in nature.

1
contact@[Link] 9910707562
C++ Assignment S P SHARMA CLASSES [Link]

A.) protected 22.) Constructors are used to


B.) private A.) initialise the object
C.) public B.) construct the data members
D.) static C.) Both (A) and (B)
D.) None of the above
15.) Which operator is used to define the
member of class externally? 23.) How to access the member of a class
A.) : by object?
B.) :: A.) Scope resolution operator
C.) # B.) Direct member access operator
D.) None C.) Ternary operator
D.) None of the above
16.) Which of the following is a valid class
declaration? 24.) In which case is it mandatory to
A.) class A {int x;}; provide a destructor in a class?
B.) class B {} A.) Almost in every class
C.) public class A {} B.) Class for which two or more than two
D.) object A {int x;}; objects will be created
C.) Class for which copy constructor is
17.) Pick out the other definition of defined
objects. D.) Class whose object will be created
A.) Member of the class dynamically
B.) Associate of the class
C.) Attribute of the class 25.) A constructor that does not have any
D.) Instance of the class parameter is called ..... constructor.
A.) custom
18.) How many objects can present in a B.) static
single class? C.) dynamic
A.) 1 D.) default
B.) 2
C.) 3 26.) A class named Student must have a
D.) As many as possible constructor whose name is
A.) Student
19.) Private data can be accessed by B.) ~Student
A.) class member functions C.) student
B.) functions in derived classes D.) any legal C++ name
C.) Both (A) and (B)
D.) public classes 27.) A function that is called automatically
each time an object is created, is a
20.) Objects of a class can directly use any A.) constructor
member function declared in the B.) destructor
A.) private and protected sections only C.) destroyer
B.) public and protected section only D.) terminator
C.) public section only
D.) public, protected and private section 28.) The return type you code for all
constructors is .....
21.) The scope resolution operator usually A.) void
A.) specifies a particular class B.) the class type
B.) one base class and more than one C.) the same type as the first data member
derived class defined in the class
C.) resolve ambiguities D.) no type
D.) All of the above
2
contact@[Link] 9910707562
C++ Assignment S P SHARMA CLASSES [Link]

29.) A function that is called automatically A.) all of its members are inherited
each time an object is destroyed is a B.) all of its members are inherited, except
A.) constructor for any private members
B.) destructor C.) all of its members are inherited, except
C.) destroyer for any protected members
D.) terminator D.) None of its members is inherited
unless specifically listed
30.) class X, class Y and class Z are
derived from class BASE. This ..... 36.) If we create a file by 'ifstream', then
inheritance. the default mode of the file is .....
A.) multiple A.) ios :: out
B.) multilevel B.) ios :: in
C.) hierarchical C.) ios :: app
D.) single D.) ios:: binary

31.) The derivation of Child class from 37.) To perform file I/O operations, we
Base class is indicated by ..... symbol must use ..... header file,
A.) :: A.) <ifstream>
B.) : B.) <ofstream>
C.) ; C.) <fstream>
D.) | D.) Any of these

32.) When a base class is privately 38.) To create an output stream, we must
inherited by the derived class, then ..... declare the stream to be of class .....
A.) ofstream
A.) protected members of the base class
B.) ifstream
become private members of derived class C.) iostream
B.) public members of the base class D.) None of these
become private members of derived class
C.) Both (A) and (B) 39.) Which of the following is not a file
D.) Only B opening mode?
A.) ios:out
33.) Inheritance is the principle that B.) ios::in
A.) classes with the same name must be C.) ios::app
derived from each another D.) ios::truncate
B.) knowledge of a general category can
be applied to more specific objects 40.) ..... is return type of is_open() function.
C.) C++ functions may be used only if A.) int
B.) bool
they have' logical predecessors
C.) float
D.) one function name may invoke D.) char*
different methods
41.) Which of the following is not used to seek
34.) Which of the following is true? a file pointer?
A.) A derived class may have more than A.) ios::cur
one base class B.) c:ios::end
B.) A base class may have more than one C.) ios::set
derived class D.) ios:beg
C.) Both (A) and (B)
D.) A base class is not a super class 42.) Which among following is correct syntax
of closing a file in C++?
35.) When a class serves as a base class to A.) myfile$close();
B.) myfile@close();
others, .....

3
contact@[Link] 9910707562
C++ Assignment S P SHARMA CLASSES [Link]

C.) myfileclose(); C.) fp = fopen("abc","w");


D.) [Link](); D.) None of the mentioned

43.) What is the use of eof()? 50.) What does the following statement mean?
A.) Returns true if a file open for reading has int(*fp)(char*)
reached the next character. A.) pointer to a pointer
B.) Returns true if a file open for reading has B.) pointer to an array of chars
reached the next word. C.) pointer to function taking a char*
C.) Returns true if a file open for reading has argument and returns an int
reached the end. D.) function taking a char* argument and
D.) Returns true if a file open for reading has returning a pointer to int
reached the middle.
51.) The operator used for dereferencing or
44.) Which functions allow to change the indirection is .....
location of the get and put positions? A.) *
A.) sg() and sp() B.) &
B.) sekg() and sekp() C.) ->
C.) gog() and gop() D.) ->>
D.) seekg() and seekp()
52.) Choose the right option
45.) Which is correct syntax for position n string* x , Y;
bytes back from end of fileObject? A.) x is a pointer to a string, y is a string
A.) [Link](ios:end,n); B.) y is a pointer to a string, x is a string
B.) [Link](n, ios:end); C.) Both x and y are pointer to string types
C.) [Link](n, ios::end); D.) None of the mentioned
D.) [Link](ios:end,n);
53.) Which one of the following is not a
46.) The first and second arguments of fopen possible state for a pointer?
are A.) Hold the address of the specific object
A.) a character string containing the name of B.) Point one past the end of an object
the file and the second argument is the mode. C.) Zero
B.) a character string containing the name of D.) Point to a type
the user and the second argument is the mode.
C.) a character string containing file pointer 54.) Which of the following is illegal?
and the second argument is the mode. A.) int *ip;
D.) None of the above B.) string s, *sp;
C.) int i; double* dp = &i;
47.) How to get position n bytes forward in D.) int* pi = 0;
fileObject?
A.) [Link] (ios::cur,n); 55.) Only functions of the class can access the
B.) [Link](n,ios:cur); data of the class and they (functions) provide
C.) [Link](n,ios::cur); the interface between data, objects and the
D.) [Link](ios:cur,n); program. This kind of isolation of the data
from direct access by the program is called .....
48.) How to get position to the nth byte of A.) data abstraction
fileObject? B.) data hiding
A.) [Link]('filename',n); C.) data binding
B.) [Link](n,'filename'); D.) data encapsulation
C.) [Link](n);
D.) [Link](n,ios::app); 56.) ..... is the OOP feature and mechanism
that binds together code and the data it
49.) Which of the following fopen statements manipulates, and keep both safe from outside
are illegal? world.
A.) fp = fopen("[Link]","r"); A.) Data binding
B.) fp = fopen("/home/user1/[Link]","w"); B.) Data encapsulation

4
contact@[Link] 9910707562
C++ Assignment S P SHARMA CLASSES [Link]

C.) Data storing 63.) The dot operator connects the following
D.) data abstraction two entities (reading from left to right)
A.) a class member and a class object
57.) The feature in object oriented B.) a class object and a class
programming that allows the same operation C.) a class and a member of that class
to be carried out differently, depending on the D.) a class object and a member of that class
object, is .....
A.) inheritance 64.) .... is a blueprint or prototype that defines
B.) polymorphism the variables and the methods common to all
C.) over functioning objects of a certain kind.
D.) overriding A.) Class
B.) Inheritance
58.) Consider an operation of addition. C.) Object
For two numbers the operation will generate a D.) Polymorphism
sum. If the operands are strings, and the same
operation would produce a third string by 65.) Which of these following members are
concatenation. This feature is called not accessed by using direct member access
A.) inheritance operator?
B.) encapsulation A.) public
C.) polymorphism B.) protected
D.) binding C.) private
D.) Both (B) and (C)
59.) A C++ program contains a function with
the header int function (double d, char c); 66.) Which of the following remarks about the
Which of the following function headers could differences between constructors and
be used within the same program? destructors are correct?
A.) char function (double d, char c) A.) Constructors can take arguments but
B.) int function (int d, char c) destructors cannot.
C.) Both (A) and (B) B.) Constructors can be overloaded but
D.) float function (double d, char c) destructors cannot be overloaded.
C.) Destructors can take arguments but
60.) In C++, we can use the same function constructors cannot.
name to create functions that perform a variety D.) Both (A) and (B)
of different tasks. This is known as
A.) global function 67.) If default constructor is not defined, then
B.) function overloading how the objects of the class will be created?
C.) inheritance A.) The compiler will generate error
D.) All of the above B.) Error will occur at run time
C.) Compiler automatically provides its
61.) The feature that allows you to use the default constructor to build the object
same function name for separate functions that D.) None of the above
have different argument lists is called
A.) overriding 68.) Assume a class TEST. Which of the
B.) overloading following statements is/are responsible to
C.) constructing invoke copy constructor?
D.) destructing A.) TEST T2 (T1)
B.) TEST T4 = T1
62.) What is the term used to describe the C.) T2 = T1
situation when a derived class provides a D.) Both (A) and (B)
function already provided in the base class?
A.) Overloading 69.) When the compiler cannot differentiate
B.) Overriding between two overloaded constructors, they are
C.) Polymorphism called
D.) Encapsulation A.) overloaded
B.) destructed

5
contact@[Link] 9910707562
C++ Assignment S P SHARMA CLASSES [Link]

C.) ambiguous C.) private


D.) dubious D.) friend

70.) If you omit any constructor argument 76.) What is difference between protected and
when you instantiate an object, you must use private access specifier in inheritance?
default values A.) private member is not inheritable but
A.) for all parameters to the constructor accessible in derived class
B.) for all parameters to the right of the B.) protected member is inheritable and also
argument accessible in derived class
C.) for all parameters to the left of the C.) Both are inheritable but private is
argument accessible in the derived class
D.) for no other parameters D.) Both are inheritable but protected is not
accessible in the derived class
71.) Assume that we have constructor
functions for both base class and derived class. 77.) In case of inheritance where both base and
Now consider the declaration in main(). derived classes are having constructors, when
Base * P = New Derived; an object of derived class is created then .....
In what sequence will the constructor be A.) constructor of derived class will be
called? invoked first
A.) Derived class constructor followed by base B.) constructor of base class will not be
class constructor invoked
B.) Base class constructor followed by derived C.) constructor of derived class will be
class constructor executed first followed by base class
C.) Base class constructor will not be called D.) constructor of base class will be executed
D.) Base class constructor will not be called first followed by derived class

72.) Which of the following is the invalid class 78.) If base class has constructor with
declaration header for the derived class d with arguments, then it is ..... for the derived class
base classes b1 and b2? to have constructor and pass the arguments to
A.) class d : public b1, public b2 base class constructor.
B.) class d : class b1, class b2 A.) optical
C.) class d : public b1, b2 B.) mandatory
D.) class d : b1, b2 C.) compiler dependent
D.) error
73.) Let class APE be a friend of class
SAPIEN. Let class HUMAN be a child class 79.) When a child class function is called, the
of SAPIEN and let MONKEY be a child class compiler looks first for matching function
of APE. Then name in the .....
A.) SAPIEN is not a friend of APE A.) class of the object using the function name
B.) APE is not a friend of HUMAN B.) immediate ancestor class
C.) MONKEY is not a friend of SAPIEN C.) base class
D.) All of the above D.) descendant class
80.) Assume the C++ definition:
74.) When a child class inherits from more class circle : public point
than one parent class, this type of inheritance Which of the following is false?
is called ..... inheritance. A.) point is the base class and circle is the
A.) hierarchical derived class.
B.) hybrid B.) The colon (:) in the header of class
C.) multilevel definition indicates inheritance.
D.) multiple C.) The keyword 'public' indicates visibility
mode of inheritance
75.) During a class inheritance in C++, if the D.) All the public and protected members of
visibility mode or mode of derivation is not class 'circle' are inherited as public and
provided, then by default visibility mode is ..... protected members respectively, into class
A.) public 'point'.
B.) protected
6
contact@[Link] 9910707562
C++ Assignment S P SHARMA CLASSES [Link]

81.) Which one of the following accurately C.) ios::ann


describes "multiple inheritance"? D.) ios::end
A.) When a child class has both an "is a" and a
"has a" relationship with its parent class. 88.) What will happen in this code?
B.) When two classes inherit from each other int a = 100, b = 200;
C.) When a base class has two or more derived int* p = &a, *q = &b;
classes p = q;
D.) When a child class has two or more parent A.) b is assigned to a
classes. B.) p now points to b
C.) a is assigned to b
82.) Streams that will be performing both D.) q now points to a
input and output operations must be declared
as class ..... 89.) The correct statement for a function that
A.) iostream takes pointer to a float, a pointer to a pointer to
B.) fstream a char and returns a pointer to a pointer to a
C.) stdstream integer is
D.) stdiostream A.) int** fun(float**, char**)
B.) int** fun(float*, char*)
83.) If we have object from of ofstream class, C.) int** fun(float*, char**)
then default mode of opening the file is D.) int***fun(*float, **char)
A.) ios::in
B.) ios::out 90.) In C++, which of the following statements
C.) ios::in | ios::trun correctly returns the memory from the
D.) ios::out | ios::trunc dynamic array pointer pp to the free store?
A.) delete pp;
84.) If we have object from fstream class, then B.) delete pp [];
default mode of opening the file is ..... C.) delete [] pp;
A.) ios::in | ios::out D.) delete *pp;
B.) ios::in | ios::out | ios::trunc
C.) los:: | ios::trunc 91.) Object based language differ from object
D.) Default mode depends on compiler oriented language as it does not support
features
85.) Which of the following is correct syntax (i) encapsulation
with respect to data file handling? (ii) inheritance
A.) myfile:open("[Link]",ios::out); (iii) abstraction
B.) [Link]("[Link]",ios::out); (iv) polymorphism
C.) myfile::open("[Link]",ios::out); A.) (iii), (iv)
D.) [Link]("[Link]",ios:in); B.) (i), (iii), (iv)
C.) (ii), (iii)
86.) What does the following segment of code D.) (ii), (iv)
do?
fprintf(fp,"Copying"); 92.) Match the following with their
A.) It writes "Copying!" into the file pointed description.
by fp List I List II
B.) It reads "Copying!" from the file and prints
on display i. The capability to write on
C.) It writes as well as reads "Copying!" to and a. Encapsulation function or method that works in
from and file and prints it variety of different ways.
D.) None of the mentioned

87.) Which is among following is used to open ii. The capability of a class relay
b. Aggregation
a file for output and move the read/write upon another class.
control to the end of the file?
A.) ios::ate iii. The capability to store one
c. Inheritance
B.) ios::at object inside of another object

7
contact@[Link] 9910707562
C++ Assignment S P SHARMA CLASSES [Link]

iv. The capability to store related A();


d. Polymorphism
information.
A.) a-iv, b-iii, c-ii, d-i II) A();
Q) class A: public B, public
B.) a-iii, b-i, c-ii, d-iv B();
C
C.) a-iii, b-iv, c-i, d-ii A();
D.) a-i, b-iii, c-iv, d-ii
R) class A: public B, virtual III) A();
93.) Consider the following statements: public C B();
char *ptr="Hello";;
cout<<*ptr; IV) C();
What will be printed? B();
A.) first letter A();
B.) entire string
V) B();
C.) it is a syntax error
A();
D.) last letter
A.) P-III, Q-II, R-I
94.) Which of the followings are true about B.) P-V, Q-I, R-IV
constructors? C.) P-III, Q-I, R-IV
(i) A class can have more than one constructor D.) P-V, Q-II, R-I
(ii) They can be inherited
(iii) Their address can be referred 97.) Which constructor will be called by the
(iv) Constructors cannot be declared in following lines of code?
protected section of the class (i) Student s1;
(v) Constructors cannot return values (ii) Student s2 = s1;
A.) (i), (ii), (iv) A.) First copy constructor, then default
B.) (i), (ii), (v) constructor
C.) (i), (iii), (v) B.) First default constructor, then copy
D.) (i), (iv), (v) constructor
C.) Default constructors for both lines of code
95.) Which of the following statements are not D.) Copy constructor for both lines of code.
true about destructor?
(i) It is invoked when object goes out of the 98.) Which of the statements are true?
scope (i) Function overloading is done at compile
(ii) Like constructor, it can also have time.
parameters (ii) Protected members are accessible to the
(iii) It can be virtual member of derived class.
(iv) It can be declared in private section (iii) A derived class inherits constructors and
(v) It bears same name as that of the class and destructors.
precedes Lambda sign (iv) A friend function can be called like a
normal function
(v) Nested class is a derived class.
A.) (ii), (iii), (v) A.) (i), (ii), (iii)
B.) (ii), (iii), (iv) B.) (iii), (iv), (v)
C.) (ii), (iv) , (v) C.) (ii), (iii), (v)
D.) (iii), (iv), (v) D.) (i), (ii), (iv)

96.) Match the following. 99.) When base class is derived in protected
mode, then .....
Table: Execution of base class constructor (i) public members of base class become
private members of derived class
Order of
Method of Inheritance (ii) public members of base class become
Execution
protected members of derived class
I) B(): (iii) public members of base class become
P) class B : public A public members of derived class
C();
(iv) protected members of base class become
8
contact@[Link] 9910707562
C++ Assignment S P SHARMA CLASSES [Link]

protected members of derived class {


(v) protected members of base class become int age;
private members of derived class char name[20];
(vi) protected member of base class become }
public members of derived class A.) 5
A.) (i), (v) B.) 24
B.) (i), (vi) C.) 21
C.) (ii), (vi) D.) 22
D.) (ii), (iv)
104.) Consider the following class definitions:
100.) In case of inheritance, where both base class A
and derived classes are having constructor and {
destructor, then which if the following are };
true? class B : protected A
(i) Constructor are executed in their order of {
derivation };
(ii) Constructors are executed in reverse order What happens when we try to compile this
of derivation class?
(iii) Destructors are executed in their order of A.) will not compile because class body of A
derivation is not defined
(iv) Destructors are executed in reverse order B.) will not compile because class body of B is
of derivation not defined
A.) (ii), (iv) C.) will not compile because class A is not
B.) (i), (iii) public inherited
C.) (i), (iv) D.) will compile successfully
D.) (ii), (iii)
105.) What is the output of this program?
101.) Which of the following are member class rect
dereferencing operators in CPP? {
(i) * int x, y;
(ii) :: public:
(iii) ->* void val(int, int);
(iv) :* int area()
A.) (i) and (iii) {
B.) (i) and (v) return (x*y);
C.) (iii) and (iv) }
D.) (ill), (iv), (v) };
void rect:: val(int a, int b)
102.) The return value of the following code is {
class1 & test (class1 obj) x = a;
{ y = b;
class1 *ptr = new class1(); }
..... void main()
return ptr; {
} rect r;
A.) object of class1 [Link](3, 4);
B.) reference to ptr cout<<"react area:"<<[Link]();
C.) reference of class1 }
D.) object pointed by ptr A.) rect area:3
B.) rect area: 12
C.) rect area: 24
D.) None of these
103.) If an integer occupies 4 bytes and a
character occupies 1 byte of memory, each 106.) What is the output of the following
element of the following class would occupy program?
how many bytes? class Box
9
contact@[Link] 9910707562
C++ Assignment S P SHARMA CLASSES [Link]

{ A.) 5
public: B.) 10
double length,breadth; C.) 15
double height; D.) address of b
};
void main() 109.) What is the output of this program?
{ void main()
Box Box1; {
double volume; char arr[20];
[Link] = 5; int i;
[Link] = 6; for(i=0; i<10; i++)
[Link] = 7.1; *(arr + i) = 65+i;
volume = [Link]* *(arr + i) = '\0';
[Link]*[Link]; cout<<arr;
cout<<volume; }
} A.) ABCDEFGHIJ
A.) 210 B.) AMAAAAAAA
B.) 213 C.) JJJJJJJ
C.) 215 D.) None of the mentioned
D.) 217
107.) What is the output of this program? 110.) What is the output of this program?
class sample void main()
{ {
private: char *ptr;
int var; char Str[] = "abcdefg";
public: ptr = Str;
void input() ptr += 5;
{ cout<<ptr;
cout<<var; }
} A.) fg
void output() B.) defg
{
C.) cdef
cout<<"Variable entered is";
cout<<var<<"\n"; D.) abcd
} Q111 C++ is a
} a) Top down programming approach
void main() b) Procedurally oriented approach
{ c) Bottom-up programming approach
sample object; d) None of these
[Link](); Q112 default return type for all function in
[Link](); c++
[Link](); A) int
} b) float
A.) Enter an integer 5 Variable entered is 5 c) void
B.) runtime error
d) char
C.) error
Q113.c++ developed by whom and when
D.) None of the mentioned
a) Bjarne Stratroup & 1980
b) Dennis Retchie & 1982
108.) What is the output of this program?
void main() c) Bjarne Stratroup & 1982
{ d) None of these
int a = 5, b = 10, c = 15; [Link] is reference variable in c++?
int *arr[] = {&a,&b,&c}; a) To create the alias name of particular
cout<<arr[1]; variable and operator
}; b) To create a pointer
c) To create address

10
contact@[Link] 9910707562
C++ Assignment S P SHARMA CLASSES [Link]

d) None of these d) None of these


[Link] is known as compound [Link] c++ class variables are known as
assignment operator a) Objects
a) + b) Function
b) = c) Data members
c) += d) None of these
d) =+ [Link] can be defined and used inside a
Q116 if we are using the same function name function are known as
to create function that performs a variety of a) Local class
different tasks this is known as b) Inherit class
a) Function overloading c) Base class
b) Function polymorphism d) Derived class
c) None of these Q126. Which namespace is used in c++ by
d) Both a and b default?
Q117 class is a a) ctd
a) User define date type b) std
b) Same as the structure c) gld
c) Simple data type d) cin
d) None of these Q127. Is dynamic initialization is possible in
[Link] of data and function c++
together into a single class is known as a) Yes
a) Encapsulation b) No
b) Data binding c) None
c) Both of these d) Both
d) None of these Q128. What is use of scope resolution
Q119. By default member of the class is operator?
a) Public a) To access a global variable
b) Private b) To access a local variable
c) Protected c) Both of these
d) None of these d) None of these
Q120 function and variable are collective of a Q129. An inline function
class called as a) Which is defined inside a class?
a) Class member b) Consist of small code
b) Class variable c) Compiler has the compulsion to accept his
c) Class pointer request
d) None of these d) Both a and b
Q121. By default the members of structure Q130. When a language has the capability to
are produce new data type
a) public a) Extensible
b) private b) Overloaded
c) protected c) Encapsulated
d) none of these d) Reprehensible
Q122. To declare generic pointer we use
which data type For Video Explanation of these
a) star
b) void question, Subscribe our Test
c) class Series package of TGT / PGT /
d) double
Q123. A variable declares as private can be UP-LT / GATE on
directly accessed by
a) Objects [Link]
b) Through a member function S P SHARMA CLASSES
c) Through another private member
9910707562
11
contact@[Link] 9910707562

You might also like