Check out example codes for "java list get first element". It will help you in understanding the concepts better.

Code Example 1

list.get(0);

Code Example 2

!list_or_set.isEmpty()

Code Example 3

set.iterator().next();

Learn ReactJs, React Native from akashmittal.com