List<String> yourList=new ArrayList<>();//short form of Arraylist<String> as the compiler infers the <String> from the left side of the assignment
yourList.add("Hello");
yourList.add(123);//compiler Error
String firstElement=yourList.get(0);
Integer firstElement=yourList.get(0);//compiler Error
Code Example |
---|
:: |
:: |
:: |
Java :: |
:: |
:: |
Java :: |
:: |
Java :: |
:: |
Java :: |
:: |
Java :: |
:: |
:: |
:: |
:: javascript remove all but numbers |
:: |
:: |
:: |
Javascript :: |
:: |
Javascript :: |
Javascript :: |
:: |
:: |
:: |
:: |
:: |
Javascript :: |