CS 106A Lecture Notes - Lecture 6: Instance Variable, Dynamic Array, Concurrent List

26 views4 pages

Document Summary

Lecture notes array lists: tips for hangman, use array lists to do file reading part, file reading last time, list stuff this time, array list intro, ordered list of stuff a. i. Makes reference to array list before and after java 1. 5 b. ii. b. iii. Ignore everything before java 1. 5: templatized type. parameterized type: doesn"t actually show up in java code, we will replace t by some type b. i. that type will represent what the array list contains. represents whatever type is in the array list: d, declaring array list, uppercamelcase because it is a class. //so all items in list are strings: this changes rest of code to replace Arraylist strlist = new arraylist(); strlist. add( hi ); strlist. add( there ); println(strlist. get(0)); println(str. listget(1)); //list has 1 item: added in order d. i. d. ii. Println(strlist. get(2)): this will create big error, exception f. i. Object version of these types still work like primitives = immutable c. i. 1.

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