brennadrummond5042 brennadrummond5042
  • 25-07-2019
  • Computers and Technology
contestada

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

Respuesta :

Branta Branta
  • 01-08-2019

Answer:

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.

Answer Link

Otras preguntas

Calculate the mass percent 250g of salt solution that has 3.50g salt residue
Who was responsible for passing the Canadian bill of rights?
Which revision is necessary? add a comma after ""trip"" add a comma after ""london"" add a comma after ""shazia"" add a comma after ""and""
Evaluate. {3−[−4−(6+2)]}⋅(−5) A−75 B−57 C−15 D−9
What was the international response to the holocaust
1+1 wrong answer only
Determine the Angle Measures
5 Select the correct answer from the drop-down menu. How does the third paragraph refine the author's claim about the new spacesuit? It explains how the new spa
I’m not good at math PLEASE HELP
Which revision exhibits the best word choice for the underlined portion of the sentence? riding without one is dangerous and reckless. riding without one is ins