CS 106A Lecture Notes - Lecture 6: Instance Variable, Dynamic Array, Concurrent List
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.