Solved

Assume an Array-Based List Implemented by a Class That Uses

Question 16

Multiple Choice

Assume an array-based list implemented by a class that uses the fields
String [ ] list;
Int nElements;
To represent the array of elements,and the number of elements currently stored.Assuming there is space
In the internal array,the code for adding a new item str to the end of the list is


A) list.add(str) ;
B) list[nElements] = str;
C) list[nElements] = str;nElements++;
D) nElements ++;list[nElements] = str;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents