Document Summary

Java api provides collections, used to store groups of related objects. Arrays do not automatically change their size at execution time to accommodate additional elements. Arraylist can dynamically change its size to accommodate more elements. T is a placeholder for type of element stored in collection. Classes with this kind of placeholder that can be used with any type are called generic classes. Contains-returns true of the arraylist contains the specified element. Get-returns the element at the specified index indexof-returns the index of the first occurrence of specified element. Remove-2 versions, removes first index or specified index. Size-returns number of elements stored in arraylist elements trimtosize-trims the capacity of the arraylist to current number of. Example:private final static color violet = new color(128, 0, 128);//jpanel. Example: foo f = new foo();//f is a reference. Foo f2=f;//new variable, not new object, points to class foo.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions