Classes

Classes

University

9 Qs

quiz-placeholder

Similar activities

Object/Abstract/Final in JAVA

Object/Abstract/Final in JAVA

University

10 Qs

Data Modeling

Data Modeling

University

8 Qs

AITT LAB QUIZ  4

AITT LAB QUIZ 4

University

10 Qs

Inheritance

Inheritance

University

10 Qs

OOP Lesson 2

OOP Lesson 2

University

8 Qs

java quiz on Encapsulation and Abstraction

java quiz on Encapsulation and Abstraction

University

10 Qs

Q4 - Comp Vision

Q4 - Comp Vision

University

10 Qs

OBJECT ORIENTED PROGRAMMING WITH JAVA

OBJECT ORIENTED PROGRAMMING WITH JAVA

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