Infosys Interview Question

Write function and main for reversing the elements of an array in java.