Tech Mahindra Interview Question

Q3. How do you restrict inhertiance?