Pergunta de entrevista da empresa Siemens

How does inheritance work in programming?