SAP interview question

Inheritance difference in java and c++