COMP 202 Lecture Notes - Lecture 29: Dynamic Array, Hash Table, Value Type
jc123 and 40170 others unlocked
100
COMP 202 Full Course Notes
Verified Note
100 documents
Document Summary
We have access to arraylists, which allow us to create array-like objects without choosing a size in advance. If you want to use an array, but you don"t know how big your array will be, use an arraylist instead. It works in java -- not all programming languages have arraylists. Types have to be reference types, not primitive. You can use the wrappers" to turn primitive types into reference types. After using this to declare the type of arraylist, you can basically ignore the fact that it"s reference and not primitive, and use int as you normally would. Immutable reference types behave similarly to primitive types on the surface. New--: practice: strings and array lists . Write a method that takes as input an array of strings, as well as a letter. It should return an arraylist of all the strings in the array that start with that letter.