tennesseelkp.blogg.se

Functional programming language list
Functional programming language list






functional programming language list

The delete(element, listname) method is used to delete the specified element from the list & it returns the new list.

functional programming language list

The append(listfirst, listsecond) method is used to create a new list by adding two lists. In this section, we will discuss some operations that can be done over lists in Erlang. Int lastIndexOf(Object) returns the index of the last occurrence of a specified element in a list, else it returns -1 when the element is not found. Int indexOf(Object) method returns the index of the first occurrence of a specified element in a list, else it returns -1 when the element is not found. The following three methods are used as per the requirement −īoolean contains(Object) method returns true if the list contains the specified element, else it returns false. The methods collection.sort() and collection.reverse() are used to sort a list in ascending or descending order. The set(index,element) method is used to update an element at a specified index with a specified element. The getfirst() & getlast() methods can be used in LinkedList class. The get() method is used to retrieve elements from a list at a specified location.

functional programming language list

Note − To remove all elements from the list clear() method is used. The methods remove(index) or removeobject() are used to remove elements from a list. The methods add(Object), add(index, Object), addAll() are used to add elements into a list. In this section, we will discuss some operations that can be done over lists in Java.








Functional programming language list