stackoverflow.What, , somecode , . , , stackoverflow...
arraylist .
, , .
ArrayList<String> list=new ArrayList<>();
generics,
ArrayList list =new ArrayList();
generics.If generics, . , .
for (Object o:list)
{
String s=(String)o;
System.out.println(s);
}
- this is what you need to do if you are not using generics. If you use generics
then
for(String s:list)
{
System.out.println(s)
}
Hope this helps .... :)
source
share