Tata Power SED Interview Question

basics in java,