CSE 115 Lecture 25: 03.28.16 lecture notes

30 views4 pages

Document Summary

Arraylist words; words = new arraylist(); words. add( cat ); words. add( dog ); words. add( rabbit ); for (string w : words) { A rabbit is a good pet for statement for ( ; ; ) for loop. A rabbit is a good pet iterator method of collection. Returns an iterator over elements currently in collection java. util. iterator An iterator guarantees to visit all members of a collection exactly once between the time it is created to the time its hasnext() method returns false java. util. iterator interface. Call to hasnext() can be used to control while loop. Arraylist words; words = new arraylist(); words. add( cat ); words. add( dog ); words. add( rabbit ); A string object holds a sequence of char values. The length() method returns the number of characters in the string. Each char value has a position (index) within the string. An index is an integer between 0 and the length() of the string, inclusive at.

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