Cognizant interview question

JAVA basic question like oops & all