Difference between Final Class and Abstract Class

Final Class: A Class which Can't be inherited by other class, that class is called final class. You all knows that final class is inbuilt in java. But in C++ you have to create final class.Two types of Final class, you can create . One who want to create object of final class on Heap and other who wants to create object of Final class on stack.

1.It makes use of private constructor, virtual inheritance and friend class.

2.In place of priavte constructor, use private Destructor. Because Constructor can be overloaded and Destructor can'nt be overloaded.

No comments:

Post a Comment