Week 6 Inheritance Vector, ArrayList and LinkedList

 0    11 Datenblatt    up804653
mp3 downloaden Drucken spielen überprüfen
 
Frage English Antworten English
What are some of the problems of array structures?
Lernen beginnen
all elements must be same type, number of elements predetermined, inefficent
what does ArrayIndexOutOfBoundsException message indicate?
Lernen beginnen
you are making reference to an array index that is larger or smaller than the actual array.
what is a Vector
Lernen beginnen
the vector class in java is a kind of list that can grow as needed
What is a linkedList
Lernen beginnen
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);
Lernen beginnen
the vector will double its allocated space
when would you use a vector?
Lernen beginnen
if a thread-safe implementation is needed
if a thread-safe implementation is not needed what class would you use inplace of vector?
Lernen beginnen
ArrayList
are linked lists synchronised or unsynchronised?
Lernen beginnen
unsynchronised
what code do you use to rentern the number of items in an array list?
Lernen beginnen
int size();
what does Object get(int index); do for ArrayLists?
Lernen beginnen
//returns element at index without removing it
what does Object remove(int index) do for ArrayLists?
Lernen beginnen
//removes element at index and shifts up rest

Sie müssen eingeloggt sein, um einen Kommentar zu schreiben.