Alright, it's time to tackle 2D arrays and arrayLists. 2D arrays are basically arrays of arrays. First off, 2D arrays: 2D Arrays To start off with, the declaration and instantiation. Since 2D arrays are objects, we will use the new operator. There are several ways to do this: The "normal" way:data type [] [] name = new data type... Continue Reading →
APCS Ch 6: Sorting and Searching Methods
Sorting methods as it pertains to arrays isn't the simplest thing to wrap your head around but the concept and the way they should work should be pretty intuitive. You would need to know about two main sorting methods in APCS; the selection sort and the insertion sort. Like the different types of loops, both of these... Continue Reading →
APCS Ch 6: Arrays Basics
Arrays are basically lists of things. This list can contain both objects and primitive data. The basic array can be declared and instantiated as such: (data type)[ ] (arrayname) = new (data type) [(number of elements)]; Since arrays are considered as objects, the declaration and instantiation follow the pattern of other objects. So, if I... Continue Reading →