find the shortest string in java strings array

ht‮//:spt‬www.lautturi.com
find the shortest string in java strings array
public static String shortest(String words[]) {
    if (words == null || words.length < 1) {
        return "";
    }
    String smallest = words[0];
    for (int i = 1; i < words.length; i++) {
        if (words[i].length() < smallest.length()) {
            smallest = words[i];
        }
    }
    return smallest;
}
Created Time:2017-09-05 21:01:41  Author:lautturi