Cognizant interview question

Write JAVA program to find the maximum element in an array.