ArrayList: equals(Object o) : ArrayList « java.util « Java by API






ArrayList: equals(Object o)

  
import java.util.Arrays;
import java.util.List;

public class Main {

  public static void main(String[] a) {

    List list = Arrays.asList(new String[] { "A", "B", "C", "D" });
    List list2 = Arrays.asList(new String[] { "A", "B", "C" });

    System.out.println(list.equals(list2));
  }
}

   
    
  








Related examples in the same category

1.new ArrayList < E > ()
2.new ArrayList(Collection c)
3.ArrayList: add(E o)
4.ArrayList: add(int index, E element)
5.ArrayList: addAll(Collection c)
6.ArrayList: addAll(int index, Collection c)
7.ArrayList: clear()
8.ArrayList: contains(Object elem)
9.ArrayList: ensureCapacity(int minCapacity)
10.ArrayList: get(int index)
11.ArrayList: indexOf(Object elem)
12.ArrayList: isEmpty()
13.ArrayList: iterator()
14.ArrayList: lastIndexOf(Object o)
15.ArrayList: listIterator()
16.ArrayList: remove(int index)
17.ArrayList: remove(Object o)
18.ArrayList: removeAll(Collection c)
19.ArrayList: retainAll(Collection c)
20.ArrayList: set(int index, T element)
21.ArrayList: size()
22.AbstractList: subList(int fromIndex, int toIndex)
23.ArrayList: toArray()
24.ArrayList: toArray(T[] a)
25.ArrayList: trimToSize()
26.for each loop for ArrayList