The int variable "max" used in checkLargestAmongCorner represents the content of a[0], and does NOT represent the address of any element of a. Depending on the contents of a, this will definitely trigger an "index out of bounds" exception.
You should seriously read up on loops. Loops come into play when you want to process each element of an array. In this case, obviously you want to look at each element of the array to determine the largest element that the array contains.