DXC Technology interview question

Basic java question with syntax