i have an ArrayList which contains String elements and i want to add an int into the list but with out Converting that into the String is that possible.
i have tried this and this is working too.
int a1 = 10;
java.util.List list = new ArrayList<String>();
list.add(a1);
System.out.println("List element"+list.get(0));
and but i am wondering this to be happen.
int a1 = 10;
java.util.List<String> list = new ArrayList<String>();
list.add(a1);
System.out.println("List element"+list.get(0));
is that possible to do?
List<Object>And even then you'd need to.add(new Integer(a1))sinceintis not a class.