Cognizant interview question

Basic java questions and oops concepts