Write a program below |
import java.util.ArrayList;
public class Main
{
public static String findLongest(ArrayList<String> list)
{
|
|
}
public static void main(String[] args) {
ArrayList<String> values = new ArrayList<String>();
String[] words = {"cake", "candy", "lollipop", "pie"};
for (int i = 0; i < words.length; i ++)
{
values.add(words[i]);
}
System.out.println(findLongest(values));
}
}
|