Reverse An Array Using Functions In Java