financial.com interview question

Java Basics , Program Explanation