COMP 202 Lecture Notes - Lecture 29: Dynamic Array, Hash Table, Value Type

19 views6 pages
jc123 and 40170 others unlocked
COMP 202 Full Course Notes
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.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents