Is it Abecedarian?

A word is abecedarian when its letters are in alphabetical order. Step through isAbecedarian and watch the loop compare each letter with the one just before it. Java compares chars by their Unicode numbers, shown in the corner of each box.

Code


    

The string

s.charAt(i) s.charAt(i-1) pair in order pair out of order

isAbecedarian

the comparison

s.charAt(i)
 
 
<
s.charAt(i-1)