Siemens Interview Question

Basic OOPS, 1 practical question