java get first element of list or null code example
Example 1: java list get first element
list.get(0);
Example 2: java list get first element
set.iterator().next();
Example 3: java list get first element
!list_or_set.isEmpty()
list.get(0);
set.iterator().next();
!list_or_set.isEmpty()