Tech Mahindra interview question

Q3. How do you restrict inhertiance?