how to get elements of a list in java

Java
int num = list.get(0);
Source

Also in Java: