Softsuave interview question

based on core java and output prediction