import java.util.ArrayList;
import java.util.List;
public class MainClass {
public static void main(String[] args) {
List stringList1 = new ArrayList();
stringList1.add("Java 5");
stringList1.add("with generics");
String s1 = (String) stringList1.get(0);
System.out.println(s1.toUpperCase());
List<String> stringList2 = new ArrayList<String>();
stringList2.add("Java 5");
stringList2.add("with generics");
String s2 = stringList2.get(0);
System.out.println(s2.toUpperCase());
}
}
|