إذا كانت arraylist تحتوي على عنصر واحد فقط واريد حذف هذا العنصر
يظهر لي هذا error
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
لكن لو كانت arraylist تحتوي على اكثر من عنصر وتم حذف واحد لا يحدث مشكلة
مع العلم انا جربت الاثنين:
connList.remove(indexElement)
connList.remove(Elementt) بدون index
كلها نفس المشكلة
هل يوجد حل لحذف عنصر محدد من arraylist دون المرور بـ loop على كامل arraylist?
ArrayList <connID> connList= new ArrayList();
System.out.println("indexElement="+indexElement); //0
System.out.println("ListSize="+connList.size()); //1
connList.remove(indexElement);


