IBM interview question

Basics in Java and some from python