mirror of
https://github.com/System-End/APCSA.git
synced 2026-04-19 16:38:24 +00:00
12 lines
327 B
Java
12 lines
327 B
Java
public class U6_L3_Activity_One {
|
|
|
|
public static String findShortest(String[] words) {
|
|
String shortest = words[0];
|
|
for (int i = 1; i < words.length; i++) {
|
|
if (words[i].length() < shortest.length()) {
|
|
shortest = words[i];
|
|
}
|
|
}
|
|
return shortest;
|
|
}
|
|
}
|