In the JDK proper, up to version 7, no. JDK 8 will have functional programming support, though (see comment by @JBNizet below for the syntax).
You can use Guava to achieve this however:
final Function<String, Double> fn = new Function<String, Double>()
{
@Override
public Double apply(final String input)
{
return Double.parseDouble(input);
}
};
// with S the original ArrayList<String>
final List<Double> D = Lists.transform(S, fn);
Note that while there is no loop in this code, internally the code will use loops anyway.
More to the point of your original question however, you cannot cast a String to a Double, since these are two different classes. You have to go through a parsing method like shown above.
S(which should be nameds), if you reassign a new list (returned byFillTheList(), which should be namedfillTheList()) toSimmediately after?