DXC Technology interview question

Fairly easy java questions some from spring