How would you stop a class from class from being derived or
inherited?The constructer should not be Private,as object
instantiation should be allowed.
Answer Posted / mms zubeir
Thanks for your detailed answer. It's good to see you have
achieved the purpose partially by using static methods.
Still, we cannot create objects on the stack rather it
allows to create objects only on the heap. This is because,
we have to call the destructor using delete. You have
provided static methods to do that.
The compiler will not allow to create stack objects since
it cannot be able to invoke the destructor when unwinding
stack.
I do not have an idea how to fulfill this requirement.
Anyway, you have rolled out the solution to some extent.
Thanks.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Write a single instruction that will store an EVEN random integer between 54 and 212 inclusive in the variable myran. (NOTE only generate EVEN random numbers)
In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?
How can you link a c++ program to c functions?
What is the correct syntax for inheritance a) class aclass : public superclass b) class aclass inherit superclass c) class aclass <-superclass
What is a driver program?
What is the best it certification?
What is an undefined behavior and sequence points
Write about the retrieval of n number of objects during the process of delete[]p?
Why was c++ created?
What are the operators in c++?
What is the use of default constructor?
Define Virtual function in C++.
Is swift better than c++?
Is overriding possible in c++?
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.