java.util.Arrays.sort(words);
Docs.Oracle.com/en/java/javase/11/docs/api/java.base/java/util/Arrays.html#sort(java.lang.Object[])