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
Explain the benefits of proper inheritance.
Why do we need runtime polymorphism in c++?
C is to C++ as 1 is to a) What the heck b) 2 c) 10
What are the uses of pointers?
Can we use pointers in c++?
How do you define/declare constants in c++?
What are the rules about using an underscore in a c++ identifier?
Is c++ double?
Can you help me with this one? Make a program that when a user inputed a Product Name, it will display its price, and when the user inputed the quantity of the inputed product, it will show its total price. The output must be like this: Product Name: Price: Quantity: Total Price: ..this is the list of products to be inputed: Cellphone - 1500 Washing Machine - 5200 Television - 6000 Refrigirator - 8000 Oven - 2000 Computer - 11000 thanks..:D
write a corrected statement so that the instruction will work properly. if (4 < x < 11) y = 2 * x;
Differentiate between the message and method in c++?
What is the prototype of printf function?
What is the difference between reference and pointer?
Assume studentNames and studentIDs are two parallel arrays of size N that hold student data. Write a pseudocode algorithm that sorts studentIDs array in ascending ID number order such that the two arrays remain parallel.
Describe the process of creation and destruction of a derived class object?