Class Notes (838,371)
United States (325,371)
Music (10)
MUSIC 007 (8)
Cornella (7)
Lecture

C Sharp Collections.docx

3 Pages
121 Views
Unlock Document

Department
Music
Course
MUSIC 007
Professor
Cornella
Semester
Spring

Description
• C# Collections o Classes that help you keep track of and manage a bunch of data. • C# arrays o Holds a fixed number of elements, all the same type. o Int[] manyValues = new int[4]; array of 4 intergers o All starting at 0 o Counts from 0, manyValues[0] = 100 o Int[] manyValues = {100,200,300,400}; o String[] myStrings = o C# provides automatic bounds checking for arrays; o Arrays are fixed in size, once you declare them, that show big theya re. o Very efficient o Array elements are all the same type o Multi-dimensinal Arrays  Int [,] multiDimArray = new int [3,3];  Referring multiDimArray[0,1] = 100;  Row, then column = [0,1] o Array Functions are objects o They are a reference type, so you can change the source of the type • Arraylist o They are like arrays, but they can be dynamically resized as needed o Arraylist myAL = new ArrayList(); o myAL.Add(Object item) o my.AL.Remove(int index) o myAL.Count = how many items ar ein the array list o As long as its an object, you can put any type, int, string etc. • foreach loop o foreach ( object obj in myAL ) • Stacks o Maintain a list of items like arrays and ArrayLis
More Less

Related notes for MUSIC 007

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit