Cognizant Interview Question

oops questions,array list form java