1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Kazeer [188]
3 years ago
9

If the list above is named list1 and is implemented as a list, whatstatement would you use to find the number ofelements?list1.s

ize()list1.numElementslist1.lengthlist1.contains
Computers and Technology
1 answer:
vfiekz [6]3 years ago
8 0

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.

You might be interested in
Write a full class definition for a class named Counter, and containing the following members: A data member counter of type int
vfiekz [6]

// making the class

class Counter {

int counter;

int limit;

// Constructor

Counter(int a, int b){

counter = a;

limit = b;

}

// static function to increment

static increment(){

if(counter<limit)

nCounter+=1;

}

// Decrement function

void decrement(){

if(counter>0)

nCounter-=1;

}

int getValue(){

return counter;

}

static int nCounter;

int getNCounters(){

return nCounter;

}

};

// Initializa the static

int Counter::nCounter = 0;

4 0
3 years ago
(50 points) Write a programthat adds the first and last elements of an integer array and stored as the first element of the outp
Elena L [17]

Answer:

A is the input array

B = [] ; %B is initially an empty array

for i = 1:length(A)/2  %iterates over A until the midpoint of A

   B(i) = A(i) + A(end + 1 - i);  %This adds the numbers from the first half and %second half of A, and stores in B

end

disp(B)

3 0
3 years ago
Which feature of spreadsheet software can display numerical data in a visually appealing and easily understood format
Bad White [126]
A table maker makes visually appealing tables such as line graphs, bar graphs, venn diagrams on a spreadsheet software. 
8 0
3 years ago
Read 2 more answers
Which of the following represents something businesses do to keep the integrity and security of their company data?
iren [92.7K]
I’m not sure but if I wouod have to answer it would be 2 or 3
6 0
2 years ago
A reason to overload the ________ is to write classes that have array-like behaviors. parentheses ( ) operator curly braces { }
Georgia [21]

Answer:

square brackets [ ] operator

Explanation:

<h2><u>Multiple choice</u></h2>

A reason to overload the<u> square brackets [ ] operator </u> is to write classes that have array-like behaviors

5 0
3 years ago
Other questions:
  • Which of the following will most likely result in a decrease in population?
    11·2 answers
  • Match the spreadsheet features with their respective descriptions.
    7·2 answers
  • PMI is a: computer program used to help managers write mission statements. rule of thumb used to determine how many employees sh
    15·1 answer
  • Distinguish between exponentiation and modulus. Be specific.
    5·1 answer
  • ---------------is a systematic review of a person’swork and achievements over a recent period, usually leading toplans for the f
    11·1 answer
  • Algorithm of how to calculate the area of a square.
    12·2 answers
  • Explain to Alana why she might not want to blast her boss on social media just yet.<br>​
    6·1 answer
  • Areas on which the development of the computer as a communication technology is based
    5·1 answer
  • Which package is required for shadow passwords to be enabled?.
    15·1 answer
  • Suppose that you have the following definitions:
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!