The ArrayList class comes with a large array of methods (see my pun). These methods make it easy to work with the objects inside the ArrayList. The AP Computer Science A Exam does not require you to know all of the methods from the ArrayList class; however, it does require you to know...
The valid index values for an array are 0 through one less than the number of elements in the array, inclusive. If you ever accidently use an index that is too big (greater than or equal to the length of the array) or negative, you will get a run-time error called an ArrayIndexOut...
(from, length()) ● int indexOf(String str) —returns the index of the first occurrence of str; returns -1 if not found ● boolean equals(String other) —returns true if this is equal to other; returns false otherwise ● int compareTo(String other) —returns a value < 0 if this ...
The number of algorithms to learn is infinite, so rather than attempting to learn all possible algorithms, my goal is to teach you how to write an algorithm. This will be handy on the AP Computer Science A Exam when you have to either analyze or generate code to accomplish something you’...