Tech Mahindra interview question

Basics of Java