CMSC 106 Chapter Notes - Chapter 7: Search Algorithm, Binary Search Algorithm, Selection Sort

62 views4 pages

Document Summary

Chapter 7 - arrays and the arraylist class. Introduction to arrays: array- an object that can hold a group of values of the same data type int[ ] numbers; float[] temperatures = new float [100]; char [] letters = new char [5]; [6] is the array"s size declarator (# of values it can hold) Each element is assigned a subscript (an index used to pinpoint the element in the array). The first number in the array ha the index of 0. Size = temperatures. length; the . length is how long the temperatures array is. For loops can still be used in arrays for (int index = 0; index < numbers. length; index++) showvalue(numbers[index]);

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