Which of the following is the correct syntax of including a user defined header files in C++?

Ace your homework & exams now with Quizwiz!

Which among the following would destroy the encapsulation mechanism if it was allowed in programming?

Using access declaration for private members of base class

How members of an object are accessed?

Using dot operator/period symbol

What is the difference between delete and delete[] in C++?

delete is used to delete single object whereas delete[] is used to multiple(array/pointer of) objects

Which of the following is used for comments in C++?

both // comment or /* comment */

What is the size of an int data type?

Depends on the system/compiler

Which of the following is the correct difference between cin and scanf()?

cin is a stream object whereas scanf() is a function

Which function is used to read a single character from the console in C++?

cin.get(ch)

98. Pick the odd one out.

integer, enum, void

Which concept of OOP is false for C++?

Code must contain at least one class

Variable name resolution (number of significant characters for the uniqueness of variable) depends on

Compiler and linker implementations

What does polymorphism in OOPs mean?

Concept of allowing overiding of functions

Which among doesnt illustrates polymorphism?

function overriding

The format identifier %i is also used for _____ data type.

int

Which of the following is not a valid C variable name?

int $main

What is the correct syntax of declaring array of pointers of integers of size 10 in C++?

int **arr = new int*[10];

Which variable does equals in size with enum variable?

int variable

In which type does the enumerators are stored by the compiler?

integer

What will happen when defining the enumerated type?

it will not allocate memory

All keywords in C are in

lowercase

Which of the following syntax can be used to use a member of a namespace without including that namespace?

namespace::member

____ have the return type void?

none of the mentioned

Which of the following cannot be a friend?

object

Which of the following feature is not provided by C?

references

The size of an object or a type can be determined using which operator?

sizeof

Identify the incorrect option.

sizeof(char) <= sizeof(long) <=sizeof(wchar_t)

What is std in C++?

std is a standard namespace in C++

Which is known as a generic class?

template class

Which of the following is correct about this pointer in C++?

this pointer is passed as a hidden argument in all non-static functions of a class

Polymorphism is possible in C language.

true

Which data type is most suitable for storing a number 65000 in a 32-bit system?

unsigned short

Which data type is used to represent the absence of parameters?

void

Which datatype is used to represent the absence of parameters?

void

Choose the incorrect option

void is also used when the value of a pointer is null

Is bool a fundamental data type in C++?

yes

Which of the following is the correct syntax of including a user defined header files in C++?

#include "userdefined"

Which of the following is called address operator?

&amp;

Which of the following is called extraction/get from operator?

&gt;&gt;

Which of the following is called insertion/put to operator?

&lt;&lt;

What is the size of a character type in C and C++?

1 and 1

What is the size of a boolean variable in C++?

1 bit

How many characters are specified in the ASCII scheme?

128

When OOP concept did first came into picture?

1970's

What is the size of a character literal in C and C++?

4 and 1

Which of the following is the scope resolution operator?

::

How many objects can be declared of a specific class in a single program?

As many as you want

Which keyword is used to declare the friend function?

Friend

Which of the following is not a type of Constructor?

Friend constructor

If data members are private, what can we do to access them from the class object?

Create public member functions to access those data members

Out of the following, which is not a member of the class?

Friend function

In case of using abstract class or function overloading, which function is supposed to be called first?

Function with highest priority in compiler

Which among the following violates the principle of encapsulation almost always?

Global variables

A language which has the capability to generate new data types are called

Extensible

Which is used to indicate single precision value?

F or f

Functions cant return objects.

False

Pure OOP can be implemented without using class in a program. (True or False)

False

Pick the odd one out.

array type

Which of the following is not a fundamental type is not present in C but present in C++?

bool

Which of the following type is provided by C++ but not C?

bool

Which type is best suited to represent the logical values?

boolean

C++ is ______________

both procedural and object oriented programming language

Which of the following is an entry-controlled loop?

both while and for

Which of the following is an abstract data type?

class

Which of the following is incorrect?

class student{ }s[];

Find which of the following uses encapsulation?

class student{int a; public: void disp(){ cout<<a;} };

Which of the following is C++ equivalent for printf()?

cout

Which function is used to write a single character to console in C++?

cout.put(ch)

Wrapping data and its related functionality into a single entity is known as

encapsulation

Identify the incorrect option.

enumerators are same as macros

When a language has the capability to produce new data type mean, it can be called as

extensible

Which of the following is not a type of inheritance?

Double-level/Distributive

Which is not feature of OOP in general definitions?

Duplicate/Redundant data

Which concept means the addition of new components to a program as it runs?

Dynamic loading

What is the other name of run-time polymorphism?

Dynamic polymorphism

Which of the two features match each other?

Encapsulation and Abstraction

What are the actual parameters in C++?

Parameters with which functions are called

The object cant be

Passed as function

Encapsulation is the way to add functions in a user defined structure.

false

How many types of polymorphism are there?

2

Encapsulation helps in writing ___________ classes in java.

Immutable

Which of the following supports the concept that reusability is a desirable feature of a language?

It reduced both testing and maintenance time

100. Find the odd one out.

std::vector&lt;bool&gt;

Which of the data types has the size that is variable?

struct

How many types of polymorphism are there in C++?

2

Which among the following is false?

Objects can't be passed by reference

Which definition best describes an object?

Instance of a class

Class is pass by

Reference

Which among the following best describes encapsulation?

It is a way of combining various data members and member functions that operate on those data members into a single unit

Why Java is Partially OOP language?

It supports usual declaration of primitive data types

Which among the following can show polymorphism?

Overloading <<

What is default access specifier for data members or member functions declared within a class without any specifier, in C++?

Private

What are the escape sequences?

Set of characters that convey special meaning in a program

Is the size of character literals different in C and C++?

Yes they are different

Can two functions declare variables(non static) with the same name.

Yes, but not a very efficient way to write programs

How many classes can be defined in a single program?

As many as you want

Which of the following shows multiple inheritances?

A,B-&gt;C

Which feature can be implemented using encapsulation?

Abstraction

Who invented OOP?

Alan Kay

Which of the following is a static polymorphism mechanism?

All of the mentioned

Why references are different from pointers?

All of the mentioned

Which problem may arise if we use abstract class functions for polymorphism?

All the derived classes must implement the undefined functions

Which of the following operator has left to right associativity?

Array element access

What is the size of wchar_t in C++?

Based on the number of bits in the system

Which of the following is used to make an abstract class?

By declaring a pure virtual function in a class

42. Which of the following is correct?

C++ allows both static and dynamic type checking

What is virtual inheritance?

C++ technique to avoid multiple copies of the base class into children/derived class

Object declared in main() function

Can't be used by any other function

Size of a class is

Classes doesn't have any size

Which of the following provides a programmer with the facility of using object of a class inside other classes?

Composition

Which of the following statement is false?

Constant variables need not be defined as they are declared and can be defined later

Which of the following cannot be used with the virtual keyword?

Constructors

While using encapsulation, which among the following is possible?

Data member's data type can be changed without changing any other code

If 2 classes derive one base class and redefine a function of base class, also overload some operators inside class body. Among these two things of function and operator overloading, where is polymorphism used?

Either function overloading or operator overloading because polymorphism can be applied only once in a program

Using encapsulation data security is

Ensured to some extent

What if we define the below structure in C and C++?

Error in C but not in C++

How structures and classes in C++ differ?

In Structures, members are public by default whereas, in Classes, they are private by default

Which of the following is correct about dynamic polymorphism?

In dynamic polymorphism, the conflict between the function call is resolved during the run time

Which of the following is correct about static polymorphism?

In static polymorphism, the conflict between the function call is resolved during the compile time

Which among the following is not true for polymorphism?

Increases overhead of function definition always

What happens if a class does not have a name?

It will not have a destructor

What is the other name used for functions inside a class?

Member functions

Which header file is required in C++ to use OOP?

OOP can be used without using any header file

If a local class is defined in a function, which of the following is true for an object of that class?

Object can be used/accessed/declared locally in that function

What are the formal parameters in CPP?

Parameters which are used in the definition of the function

Which of the following is correct about new and malloc?

Pointer object initialization of a class using new involves constructor call whereas using malloc does not involve constructor call

If same message is passed to objects of several different classes and all of those can respond in a different way, what is this feature called?

Polymorphism

What is short int in C programming?

Short is the qualifier and int is the basic data type

Which of the following class allows to declare only one object of it?

Singleton class

Which of the following is not type of class?

Start Class

Which among the following cant be used for polymorphism?

Static member functions

What is the other name of compile-time polymorphism?

Static polymorphism

79. Which of the following statement is correct?

Structure in C++ allows Constructor definition

50. Which of the following is correct in C++?

Structures can have member functions

What does modularity mean?

Subdividing program into small independent parts

Which among the following should be encapsulated?

The data which is prone to change is near future

What is name mangling in C++?

The process of adding more information to a function name so that it can be distinguished from other functions by the compiler

What is static binding?

The process of linking the actual code with a procedural call during compile-time

What is dynamic binding?

The process of linking the actual code with a procedural call during run-time

How access specifiers in Class helps in Abstraction?

They allows us to show only required things to outer world

82. Why this pointer is used?

To access the members of a class which have the same name as local variables in that scope

Which feature allows open recursion, among the following?

Use of this pointer

How can Encapsulation be achieved?

Using Access Specifiers

How run-time polymorphisms are implemented in C++?

Using Inheritance and Virtual functions

How compile-time polymorphisms are implemented in C++?

Using Templates

Which among the following can be a concept against encapsulation rules?

Using any kind of pointer/array address in passing to another function

Which of the following is a correct identifier in C++?

VAR_1234

Which of the following is true for variable names in C?

Variable names cannot start with a digit

Which type of function among the following shows polymorphism?

Virtual function

Which concept is used to implement late binding?

Virtual functions

Which of the following escape sequence represents tab?

\t

Which among the following is wrong?

abstract class student{ }; student s;

What does '\a' escape code represent?

alert

Which of the following is a User-defined data type?

all of the defined

To which of these enumerators can be assigned?

all of the mentioned

Which operator is overloaded for a cout object?

&lt;&lt;

Which of the following operator is used with this pointer to access members of a class?

-&gt;

Which of the following explains the overloading of functions?

Ad-hoc polymorphism

Which of the following is accessed by a member function of a class?

All members of a class

49. Which of the following is correct?

All of the mentioned

52. Which of the following is correct?

An object is an instance of its class

Identify the user-defined types from the following?

both enumeration and classes

Which of the following syntax for declaring a variable of struct STRUCT can be used in both C and C++?

struct STRUCT S;

78. Which of the following is correct?

struct cannot have member function in C but it can in C++

77. Which of the following is correct?

struct is not required in C++ but required in C while declaring an object of the structure

Which concept allows you to reuse the written code?

Inheritance

12. Who created C++?

Bjarne Stroustrup

Which of the following approach is used by C++?

Bottom-up

26. Which of the following is correct?

Derived class pointer object cannot point to a base class object

Which members are inherited but are not accessible in any case?

Private

Which of the following escape sequence represents carriage return?

\r

Which of the following is C++ equivalent for scanf()?

cin

Which of the following is an exit-controlled loop?

do-while

The value 132.54 can be represented using which data type?

double


Related study sets

AAA ( Authentication, Authorization, Accounting )

View Set

geometric probability assignment

View Set

chpt 17 process cost systems (IN-CLASS)

View Set

SG Lewis Ch 56 Acute Intracranial Problems

View Set

Chapter 18: Management: Making it Work

View Set

4 Ventricles and Cerebrospinal Fluid

View Set

FA 1 - The Accounting Principles

View Set

health-premature death, heart disease, cancer, etc

View Set