How would you stop a class from class from being derived or
inherited.
Answer Posted / bala
Final will do in Java. But not in C++.
I hope, bye creating all the constructor,copy constructor
in private will stop inherite the class.
Plz refer 'Singleton Pattern'
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
What are the features of oop?
What is purpose of inheritance?
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?
What is debug class?what is trace class? What differences are between them? With examples.
Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)
Why is object oriented programming so hard?
What is abstract class in oops?
Why do while loop is used?
• What are the desirable attributes for memory managment?
What is the point of polymorphism?
What is class and object in oops?
what are the realtime excercises in C++?
Can you inherit a private class?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?