Pergunta de entrevista da empresa SLB

Made a class and then derive subclass from subclass itself. How to protect a class from the inheritance.