Question
Easy
A generic function can be created using the following:
1
Inheritance
2
Data hiding
3
Polymorphism
4
Template
Question Details
Time to Solve: 12
Exam: HTET
Level/Paper: Level 3
Chapter: Object-Oriented Programming (C++)
Topic: Inheritance
Correct Answer
Option D
Explanation
The correct option is (4): The correct tool for creating a generic function is the Template. Templates are the fundamental C++ feature that enables Generic Programming, which is the philosophy of writing code that works correctly with various data types without needing to be rewritten for each one. By using a function template, you write a single blueprint for the function, defining its logic with a placeholder type. When this…Read More
Similar Questions from HTET Exam - Level 3 - Year 2021
Question 1
Easy
Source :
HTET 2021
The complement of complement of a variable is always _______.
Chapter :
Computer System & Hardware Fundamentals
Topic :
Encoding Schemes and Number System
Question 2
Easy
Source :
HTET 2021
In M. S. PowerPoint short-cut key shift + F5 is used to:
Chapter :
Office Automation Tools
Topic :
Presentation Software (MS Power-Point)
Question 3
Easy
Source :
HTET 2021
_______ is used by banking industry for pre printing of characters on the cheque.
Chapter :
Computer System & Hardware Fundamentals
Topic :
Computer System
Question 4
Easy
Source :
HTET 2021
Consider the following C++ statements:
int x; int& y = x;
The statement: y=25; $x=2*x+30$ updates the value of x and y as:
Chapter :
Python Programming Fundamentals
Topic :
Operators & Expressions