1List<String> yourList=new ArrayList<>();//short form of Arraylist<String> as the compiler infers the <String> from the left side of the assignment
2yourList.add("Hello");
3yourList.add(123);//compiler Error
4String firstElement=yourList.get(0);
5Integer firstElement=yourList.get(0);//compiler Error