Ask Question
18 February, 21:00

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

+3
Answers (1)
  1. 19 February, 00:59
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers