OOPSE questions 1-10
10 Questions
14 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Abstract class in C++:

  • may represent a parameter type of a function or method
  • is useful for declaring interfaces to other classes (correct)
  • may represent the result type of a function
  • may represent a type of pointer and object reference (correct)

output:

  • 1:(),2:(***)
  • t1:(*), t2:(***)
  • 1:(***),2:(*)
  • 1:(*),2:(***) (correct)

The order of creating members of a compound object in C++ is as follows:

  • constructor body, object fields, virtually inherited class objects, non-virtual base classes
  • object fields, constructor body, virtually inherited class objects, non-virtual base classes
  • object fields, constructor body, non-virtual base classes, virtually inherited class objects
  • virtually inherited class objects, non-virtual base classes, object fields, constructor body (correct)

Class destructor in C++ has the property:

<p>It is called automatically when the object of the corresponding type is removed from memory (B)</p> Signup and view all the answers

The 'this' keyword in C++ has the following properties:

<p>is only available in the body of class methods, and is automatically initialized (B), e.g. for class X, it is declared implicitly as: X* const this; (D)</p> Signup and view all the answers

execution of the program will display :

<p>11 (C)</p> Signup and view all the answers

Select one:

<p>a 2-parameter class template which declares an indexing operator (D)</p> Signup and view all the answers

Constructors in C++ do NOT have properties:

<p>overloaded constructors will have different names (B), even when there are explicitly defined constructors, the compiler is able to generate the default constructor (D)</p> Signup and view all the answers

Encapsulation in C++ has the following properties:

<p>The private members of a class are only accessible from the objects of the same class (C), Even members with private accessibility can be exposed for reading and writing through public setter and getter methods (D)</p> Signup and view all the answers

The following declaration in C++:

class complex; class Test { void fun() throw ( int, complex ); };

declares:

<p>a private method that can generate exceptions of types: int, complex and derived from complex (C)</p> Signup and view all the answers

More Like This

OOPS using C++
11 questions

OOPS using C++

RewardingCherryTree avatar
RewardingCherryTree
OOPSE questions 11-20
10 questions
Use Quizgecko on...
Browser
Browser