Ask Question
17 January, 01:38

If the list above is named list1 and is implemented as a list, whatstatement would you use to find the number ofelements? list1. size () list1. numElementslist1. lengthlist1. contains

+4
Answers (1)
  1. 17 January, 02:40
    0
    list1. size ()

    Explanation:

    In order to find the number of elements in a List, we can use the size () method defined in the java. util. List interface.

    This method returns an integer which corresponds to the number of elements in the list.

    The usage syntax example is as follows:

    int num = list1. size ();

    If the list referenced by list1 contains 6 elements, then this method will return the value 6.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “If the list above is named list1 and is implemented as a list, whatstatement would you use to find the number ofelements? list1. size () ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers