COMP 202 Lecture Notes - Lecture 23: Dynamic Array

53 views3 pages
jc123 and 40170 others unlocked
COMP 202 Full Course Notes
100
COMP 202 Full Course Notes
Verified Note
100 documents

Document Summary

Comp202 - lecture 23 - array list. Array list: you don"t have to decide the size of the array before hand! Arraylist numbers = new arraylist(); Arraylist words = new arraylist(); Arraylist allnumbers = new arraylist; Integer, double, and character wrap a value of the primitive type int, double, and char(respectively) in an object. Thus, they turn primitive types into reference types. The conversion between the primitive types and their wrappers is done automatically. For example, the following would not cause a compile- time error: Note that these classes have static methods/attributes that you might have already used. Autoboxing is the automatic conversion java makes between primitive data types and their corresponding object wrapper class. Note that integer, double, and characterare immutablereference types (like string). As with string, you can appear to updates values, but you are never changing the actual object. A new object gets created each time we change a value.

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