Top 1000+ Object Oriented Programming (OOP) Subject Mcqs Pdf Download Set No 19

Print/Downlaod pdf

901.The second parameter of operator functions for << and >> are objects of the class for which we are overloading these operators?

  1. True
  2. False    

902.To include code from the library in the program, such as iostream a directive would be called up using this command?

  1. #include “iostream.h”
  2. include <iostream.h>
  3. include <iostream.h>
  4. #include <iostream.h>     

903.The number 544.53 must be stored in     data type?

  1. int
  2. short
  3. float
  4. char

904.A template function can have different type of arguments? 

  1. True
  2. False

905.For which values of the integer _value will the following code becomes an infinite loop?

int number=1;

while (true {

cout << number;

if (number == 3 break;

number +=  integer_value;

 any number other than 1 or 2

  1. only 0
  2. only 1
  3. only 2

905.Template class cannot have static variables?

  1. True
  2. False

906.Which of the following is used with bit manipulation?

  1. Signed integer
  2. Un-signed integer
  3. Signed double
  4. Un-signed double

907.Structure is a collection of under a single name?

  1. Only Functions
  2. Only Variables
  3. Both Functions and Variables
  4. None of the given options

908.Which of the following is the correct C++ syntax to allocate space dynamically for an array int?

  1. new int(10 ;
  2. new int[10] ;
  3. int new(10 ;
  4. int new[10];

909.Unary operator implemented as member function takes     arguments whereas non-member function?

  1. takes   arguments.
  2. One, zero
  3. Zero, one
  4. One, two
  5. Two, one

910.The  first  parameter  of  overloaded  stream  insertion  operator  is               

where  second  parameter  is?

  1. input stream, object of class
  2. object of class, output stream
  3. output stream, object of class
  4. object of class, input stream

911.We can also do conditional compilation with preprocessor directives?

  1. True
  2. False

912.If a symbolic constant has been defined, it will be an error to define it again?

  1. True
  2. False

913.While calling function, the arguments are assigned to the parameters from?                             

  1. right to left
  2. no specific order is followed
  3. none of the given options.

914.Classes defined inside other classes are called?

classes

  1. looped
  2. nested
  3. overloaded
  4. none of the given options.

915.If we define an identifier with the statement

 #define PI 3.1415926 then during the execution of the program?

  1. the value of PI                     .
  2. cannot be replaced
  3. None of the given options
  4. Remain constant
  5. can be changed by some operation

916.Assignment operator is associative?

  1. right
  2. left
  3. binary
  4. unary    

917.If text is a pointer of class String, then what is meant by the following statement?

text = new String [5];

  1. Creates an array of 5 string objects statically
  2. creates an array of 5 string objects dynamic
  3. Creates an array of pointers to string
  4. Creates a string Object

918.Th return type of the operator function for << operator is?                   

  1. class for which we overload operator
  2. reference of ostream class (ostream&
  3. reference of istream class (istream&
  4. void

919.The code is written the program.

  1. implement
  2. design
  3. analysis
  4. none of the given options.

920.Memory allocated at run time is a system resource and it is the responsibility to de-allocate the

Memory?

  1. System
  2. Programmer
  3. User of program
  4. None of given options

921*.doc is by type?

  1. Sequential File
  2. Random Access File
  3. Data File
  4. Record File  

922.Which of the following is NOT a preprocessor directive?

  1. #error
  2. #define
  3. #line
  4. #ndefine

923.The return type of operator function must always be void?

  1. True
  2. False

924.What does *this represents

  1. The current function of the class
  2. The current pointer of the class
  3. The current object of the class
  4. A value of the data member

925.The statement cin.get ; is used to?

  1. Read a string from keyboard
  2. Read a character from keyboard
  3. Read a string from file
  4. Read a character from file

926.When we do dynamic memory allocation in the constructor of a class, then it is necessary to provide a destructor?

  1. True
  2. False  

927.Overloaded new operator function takes parameter of type size and returns?

  1. void (nothing
  2. void pointer
  3. object pointer
  4. int pointer    

928.The second parameter of operator functions for << and >> are objects of the class for which we are overloading these operators?

  1. True
  2. False

929. C++ is a case-sensitive language?

  1. True
  2. False  

930.To include code from the library in the program, such as iostream, a directive would be called up using this?

  1. #include “iostream.h”
  2. include <iostream.h>
  3. include <iostream.h>
  4. #include <iostream.h>  

931.A template function must have only generic data types

  1. True
  2. False   

932.Template class cannot have static variables?

  1. True
  2. False

933.What will be the correct syntax to assign an array named array of 5 elements t

  1. pointer PTR 
  2.      *ptr = arr ;
  3. ptr = arr ;
  4. *ptr = arr[5] ;
  5. ptr = arr[5] ; 

934.hat will be the correct syntax to access the value of fourth element of an array using pointer PTR?

  1. ptr[3]
  2. (ptr+3
  3. *(ptr+3
  4. Both 1and 3

935.If most significant bit of un-signed number is 1 then it represents a positive number.

  1. True
  2. False

 936.If there is a symbol (& sign used with the variable name followed by data type then it refers to and if & is being used with variable name then it refers to ?        .

  1. Address of variable, reference variable
  2. Reference variable, value of variable
  3. Reference variable, address of variable
  4. Address of variable, value of variable    

937.We can also do conditional compilation with preprocessor directives?

  1. True
  2. False   

938.The default value of a parameter can be provided inside the?         

  1. function prototype
  2. function definition
  3. both function prototype or function definition
  4. none of the given options.   

939.Classes defined inside other classes are called?

  1. classes
  2. looped
  3. nested
  4. overloaded
  5. none of the given options    

940.Wat purpose do classes serve?

  1. Data encapsulation
  2. Providing a convenient way of modeling real-world objects
  3. Simplifying code reuse
  4. All of the given options  

941.Every class contains?                             

  1. Constructor
  2. Destructor
  3. Both a constructor and a destructor
  4. None of the given options

942.new operator is used to allocate memory from the free store during?

  1. Compile
  2. Time Run Time
  3. Link Time
  4. None of the given options   

943.When an object of a class is defined inside another class?

  1. Destructor of enclosing class will be called first
  2. Destructor of inner object will be called first
  3. Constructor and Destructor will be called simultaneously
  4. None of the given options    

944.It is possible to define a class within another class?

  1. True
  2. False    

945.New and Delete are also used with and data types as well?

  1. Class, Objects
  2. Structures, Pointers
  3. Both Class and structures
  4. None of above 

946.With New keyword, data types and class members are initialized with meaningful values instead of garbage.

  1. True
  2. False

947.If it is required to copy an array to another array?

  • Both arrays must be of the same size and data ty
  • Both arrays may be of different size
  • Both arrays may be of different data type
  • Both arrays may be of different size and type 

948.Dealing with structures and functions passing by reference is the most economical method?

  1. True
  2. False

 949. The good(, clear(  all are manipulators?

  1. True
  2. False  

950.Overloaded new operator function takes parameter of type size_t and returns?

  1. void (void pointer
  2. object pointer

int pointer