Ask 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 () list1. numElementslist1. lengthlist1. contains

+3
Answers (1)
  1. 19 January, 08:52
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers