How to avoid a class from instantiation?
Answer Posted / vinay bondade
Have a Pure Virtual function in the class. This will not
allow to create an object of the class and hence cannot be
instatiated. But its a different thing to inherit the class
and give definition to Pure Virtual function, But the class
alone cannot be instantiated.The class hence,is also called
Abstract Base class.
| Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
Is java based off c++?
What is the use of pointer in c++ with example?
Write a function to find the nth item from the end of a linked list in a single pass.
There are 100 students in a class. The management keep information in two tables. Those two tables are given like Roll no Name Age 001 ABC 15 002 XYZ 14 and Roll No Subject Marks 001 Math 75 001 Physics 55 002 Math 68 001 Hindi 69 They want the information like this Roll No Name Hindi Physics Math Total 001 ABC 69 55 75 199 002 XYZ 68 74 84 226 And Roll No Suject Highest 001 Math 98 007 Physics 84 021 Hindi 74 All 275 All information is kept in structure in main memory. You have to find last two tables.
What is abstract keyword in c++?
Which of the following is evaluated first: a) && b) || c) !
What is the advantage of c++ over c?
What is enum class in c++?
What is stack unwinding?
How many types of comments are there in c++?
What is lambda in c++?
What is an object in c++?
What is the use of 'using' declaration in c++?
Array base access faster or pointer base access is faster?
Difference between overloading vs. Overriding