CS 1114 Lecture Notes - Lecture 10: Foreach Loop

47 views2 pages

Document Summary

Homework: read chapter vi; see string methods on last slide of week vii notes. Test ii write a loop w/ list. Upcoming assignments: begin lab x due f, 11/03 at 16:30; complete program iii due w, 11/01 at 23:59. Notes: recall ~ idioms repeat n times with a for-each loop: example: List actors = ; for(int i = 0; i < actors. size(); i++) { System. out. println(actor); : example: find the last object (counting down). Insert supplemental if-statement inside of the for-loop. if(actor. getgridx() > largestx. getgridx()) largest = actor; Notes: the three main collection types are interfaces: list, set, and map. Interfaces provides a set of methods that one can work with, but it is not a class it may provide a set of methods that one or more classes provide. It contains only method signatures and constants (no constructors or method bodies). A class that implements an interface must provide all of the methods.

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