Week 6 Inheritance Vector, ArrayList and LinkedList

 0    11 schede    up804653
Scarica mp3 Stampa Gioca Testa il tuo livello
 
Domanda English Risposta English
What are some of the problems of array structures?
inizia ad imparare
all elements must be same type, number of elements predetermined, inefficent
what does ArrayIndexOutOfBoundsException message indicate?
inizia ad imparare
you are making reference to an array index that is larger or smaller than the actual array.
what is a Vector
inizia ad imparare
the vector class in java is a kind of list that can grow as needed
What is a linkedList
inizia ad imparare
A linked list is a data structure that consists of a sequence of nodes, where each node contains some data and the address of the next node.
what will happen when you add an 11th item to: Vector(10);
inizia ad imparare
the vector will double its allocated space
when would you use a vector?
inizia ad imparare
if a thread-safe implementation is needed
if a thread-safe implementation is not needed what class would you use inplace of vector?
inizia ad imparare
ArrayList
are linked lists synchronised or unsynchronised?
inizia ad imparare
unsynchronised
what code do you use to rentern the number of items in an array list?
inizia ad imparare
int size();
what does Object get(int index); do for ArrayLists?
inizia ad imparare
//returns element at index without removing it
what does Object remove(int index) do for ArrayLists?
inizia ad imparare
//removes element at index and shifts up rest

Devi essere accedere per pubblicare un commento.