Siemens interview question

How does inheritance work in programming?