Answers for "add element at the end of list java"

1

arraylist add new element to end

//add to the end of the list
    stringList.add(random);

    //add to the beginning of the list
    stringList.add(0,  random);

    //replace the element at index 4 with random
    stringList.set(4, random);

    //remove the element at index 5
    stringList.remove(5);

    //remove all elements from the list
    stringList.clear();
Posted by: Guest on April-22-2021
3

add list to end of list python

list1.extend(list2)
Posted by: Guest on May-17-2021

Code answers related to "add element at the end of list java"

Python Answers by Framework

Browse Popular Code Answers by Language