ArrayList have metod remove(int index)
and remove(Object o)
, so
i try run this code: public static void main(String args[]){
ArrayList<Long>ar=new ArrayList<Long>();
ar.add(11L);
ar.add(22L);
ar.add(33L);
ar.remove(new Integer(33)); // 1
byte b =0;
ar.remove(b); //2
for(Iterator i=ar.iterator(); i.hasNext();)
{
System.out.println(i.next());
}
}
in result i have:
22
33
My question:
in line 1 parameter Integer - why we not have exception?
line 2 - paramenet byte - its not int and not Object, why not Exception again?