Java examples for java.util:Collection First Element
Returns the last item in the given collection
//package com.java2s; public class Main { /**/*from ww w . j a v a 2 s . c o m*/ * Returns the last item in the given collection */ public static <T> T last(Iterable<T> objects) { T answer = null; if (objects != null) { for (T object : objects) { answer = object; } } return answer; } }