Classes

Classes

University

9 Qs

quiz-placeholder

Similar activities

Java Classes

Java Classes

University

11 Qs

Object Oriented

Object Oriented

University

6 Qs

Object Oriented Programming Quizizz

Object Oriented Programming Quizizz

10th Grade - University

11 Qs

OOP Lesson 2

OOP Lesson 2

University

8 Qs

Object Oriented Programming

Object Oriented Programming

University

9 Qs

Data Modeling

Data Modeling

University

8 Qs

Quiz on OOPs- Day 1 (30-01-2025)

Quiz on OOPs- Day 1 (30-01-2025)

University

10 Qs

OOSWE_2

OOSWE_2

University

10 Qs

Classes

Classes

Assessment

Quiz

Computers

University

Hard

Created by

Yomna Elkholy

Used 9+ times

FREE Resource

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the type of access specifier that the data member number fall under?

//a simple class

class test_example{

int number;

};

Private

Public

Protected

Default

2.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Where can a protected data member be accessed?

Within the same class

Outside of the class

Within the derived class

Both within and outside the class

3.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

The concept of handling complexity by hiding the details of a class from theuser is known as:

Inheritance

Polymorphism

Abstraction

Encapsulation

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How is the template of a class different from a normal class?

Class template generates objects of classes based on the template type.

Compiler generates classes for only the used types.

Class template helps in making generic classes.

All of the above

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following means "The use of an object of one class in definition of another class", providing a Has-A relationship?

Encapsulation

Composition

Inheritance

Abstraction

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does inheritance allow in a program?

Class reusability

Creating a hierarchy of classes

Extendibility

All of the above

7.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Media Image

What will be the output of the following C++ code?

Created

Destroyed

Destroyed

Created

Compile-time error

Run-time error

8.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

Media Image

What is the output of the following program?

Base

Derived

Compilation error

None of the above

9.

MULTIPLE CHOICE QUESTION

1 min • 3 pts

Media Image

What will be the output of the following C++ code?

20

10

20

10

30