How To Check If Array Is Sorted In Java