DXC Technology Interview Question

Basic java question with syntax