What is the type of access specifier that the data member number fall under?
//a simple class
class test_example{
int number;
};
Classes
Quiz
•
Computers
•
University
•
Hard
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
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
What is the output of the following program?
Base
Derived
Compilation error
None of the above
9.
MULTIPLE CHOICE QUESTION
1 min • 3 pts
What will be the output of the following C++ code?
20
10
20
10
30
10 questions
Java quiz based on inheritance
Quiz
•
University
10 questions
Inheritance Quiz
Quiz
•
2nd Grade - University
10 questions
The OOP Quiz
Quiz
•
University
9 questions
Inheritance + java
Quiz
•
University
9 questions
Java Interface Quiz
Quiz
•
University
10 questions
INTRODUCTION TO OOPS
Quiz
•
University
8 questions
PRG521 Chap8
Quiz
•
University
10 questions
Unit 24 - Java Basics
Quiz
•
University
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade