




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An introduction to arrays, explaining what they are, how to declare and initialize them, and how to access their elements. Arrays are useful for storing similar data types and are indexed starting from zero. Examples in java and provides resources for further learning.
Typology: Slides
1 / 8
This page cannot be seen from the preview
Don't miss anything!
55 people answered the survey Wednesday is review and ungraded quiz Remember midterm on Friday! Post-HW2 midterm material questions today Sample midterm tomorrow
Arrays are convenient ways to store similar data types Much like how we have been thinking of Strings as a list of characters Arrays are also indexed starting from zero
When making an array, you need both a type and a length. The format for making an array is below: Type, [] means array variable name length of array
Arrays can be initialized by the following: If you try an access an array element that has not been initialized, your program will crash Arrays have a .length variable (similar to Strings) (See: ArrayPrintf.java)
A char array is not a String While the important data in String is a char array, classes have methods unlike arrays More examples: (See: ArrayAverage.java) (See: Fibonacci.java)