ArrayList(int index, Object) funktioniert nicht korrekt? ArrayList mit int-Werten sortieren11. I'm new to the concept of arraylist.
I had make a few line program code. Generics in Java is not applicable to primitive types as in int. I have seen the question: Create ArrayList from array.
I want to declare an ArrayList of type integer. ArrayList can only reference types, not primitives. In Java generic type arguments must be objects.
It seems I can do List myList = new ArrayList(); and add int into this list. When you add int to this list, it is automatically boxed to Integer wrapper . So you can use them as elements in a list, . This Java tutorial uses an ArrayList of Integer values to store int values. These C# examples show the ArrayList type from System.
Keine Kommentare:
Kommentar veröffentlichen
Hinweis: Nur ein Mitglied dieses Blogs kann Kommentare posten.