Classes and Objects in C++ Programming Questions and Answers - 1

Question: 1

Bjarne Stroustrup initially named C++ as

(A) C with classes

(B) Advanced C

(C) Deep C

(D) D

Ans: A

C with classes

Question: 2

Which of the following statements in NOT true?

(A) A non member function cannot access the private data of a class

(B) The return type of a member function cannot be object data type

(C) Several different classes can use the same function name

(D) Member functions can be of static type

Ans: D

Member functions can be of static type

Question: 3

int ex:: output ()
Which of the following is true with reference to the above line?

(A) The function output returns integer data type

(B) The function output returns ex type of data

(C) The class output returns integer type of data

(D) The function ex returns integer type of data

Ans: A

The function output returns integer data type

Question: 4

The body of the class starts and ends with

(A) Braces i.e.., {}

(B) Semi colon(;)

(C) Start and stop

(D) Begin and end

Ans: A

Braces i.e.., {}

Question: 5

Data abstraction in C++ is achieved by

(A) Encapsulation()

(B) Data Hiding()

(C) Polymorphism()

(D) Inheritance()

Ans: B

Data Hiding()

Error Report!

Related Questions