Magento Question:

Explain the difference between Final class and Abstract class?

Tweet Share WhatsApp

Answer:

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 private constructor, use private Destructor.
Because Constructor can be overloaded and Destructor can't be overloaded.

Download Magento PDF Read All 38 Magento Questions
Previous QuestionNext Question
Explain the difference between Mage::getSingletone() and Mage::getModel() in Magento?What are the addAttributeToFilter Conditionals in Magento?