1 min read•april 3, 2024
This guide organizes advice from past students who got 4s and 5s on their exams. We hope it gives you some new ideas and tools for your study sessions. But remember, everyone's different—what works for one student might not work for you. If you've got a study method that's doing the trick, stick with it. Think of this as extra help, not a must-do overhaul.
Tips on mindset, strategy, structure, time management, and any other high level things to know
What should a student do in the first few minutes, before they start writing?
String-based (AP 2019 question 3 for reference): Just be careful of the difference between array and ArrayList.
Accessing - in arrays we use [], and in ArrayLists we use the get() method
Modifying a value - in arrays, we do arr[position] = value, whereas in ArrayLists we do nameofthearrayList.add(value)
Primitive datatype (int or double) - Note the same things as in bullet point 1 above, but note that for ArrayList you need to use the wrapper classes Integer (for int) and Double (for double).
Objects of another class (Multiclass question) - If you are going through an array of objects be careful to do the null check to avoid NullPinterException.
Array Example:
class Student { public Student(String name) { …….. } public String getName() { …… } class School { private Student[] students; public void performAction(){ // Below is an example to access the name of the first object in the array String name = students[0].getName(); // Below is an example to add an object to a position students[0] = new Student(“Ron”); // To go through an array of objects for(int i = 0 ; i < students.length; i++) { if(students[i] != null) { System.out.println( students[i].getName()); } }
ArrayList example:
class Student { public Student(String name) { …….. } public String getName() { …… } class School { private ArrayList<Student> students; public void performAction(){ // Below is an example to access the name of the first object in the array String name = students.get(0).getName(); // Below is an example to add an object to a position students. add(new Student(“Ron”)); // To go through an array of objects for(int i = 0 ; i < students.size(); i++) { System.out.println( students.get(i).getName()); }
If you run the loop from position 0, you need to take i one position back as in the example below:
public static ArrayList<Integer> removeEvens(ArrayList<Integer> myList) { for (int i = 0; i < myList.size(); i++) { if myList.get(i) % 2 == 0) { myList.remove(i); i - -; } } return myList; }
2D array creation (AP 2021 Qn 4 Part B, AP 2019 Qn 4 Part A, AP 2022 Qn 4 Part A)
Going through a certain row/column (AP 2021 Qn 4 Part A, AP 2019 Qn 4 Part B, AP 2023 Qn 4 Part A)
Go through the entire 2D array
i. Row by Row - Row Major order ( AP 2023 Qn 4 Part B)
ii. Column by Column - Column Major order (AP 2022 Qn 4 Part B)
iii. Row major alternated (AP 2013 Qn 4 Part A)
for(int i =,..........) { if(.....//Searching condition ){ return true; } else { return false; } }
for(int i =,..........) { if(.....//Searching condition ){ return true; } return false; }
1 min read•april 3, 2024
This guide organizes advice from past students who got 4s and 5s on their exams. We hope it gives you some new ideas and tools for your study sessions. But remember, everyone's different—what works for one student might not work for you. If you've got a study method that's doing the trick, stick with it. Think of this as extra help, not a must-do overhaul.
Tips on mindset, strategy, structure, time management, and any other high level things to know
What should a student do in the first few minutes, before they start writing?
String-based (AP 2019 question 3 for reference): Just be careful of the difference between array and ArrayList.
Accessing - in arrays we use [], and in ArrayLists we use the get() method
Modifying a value - in arrays, we do arr[position] = value, whereas in ArrayLists we do nameofthearrayList.add(value)
Primitive datatype (int or double) - Note the same things as in bullet point 1 above, but note that for ArrayList you need to use the wrapper classes Integer (for int) and Double (for double).
Objects of another class (Multiclass question) - If you are going through an array of objects be careful to do the null check to avoid NullPinterException.
Array Example:
class Student { public Student(String name) { …….. } public String getName() { …… } class School { private Student[] students; public void performAction(){ // Below is an example to access the name of the first object in the array String name = students[0].getName(); // Below is an example to add an object to a position students[0] = new Student(“Ron”); // To go through an array of objects for(int i = 0 ; i < students.length; i++) { if(students[i] != null) { System.out.println( students[i].getName()); } }
ArrayList example:
class Student { public Student(String name) { …….. } public String getName() { …… } class School { private ArrayList<Student> students; public void performAction(){ // Below is an example to access the name of the first object in the array String name = students.get(0).getName(); // Below is an example to add an object to a position students. add(new Student(“Ron”)); // To go through an array of objects for(int i = 0 ; i < students.size(); i++) { System.out.println( students.get(i).getName()); }
If you run the loop from position 0, you need to take i one position back as in the example below:
public static ArrayList<Integer> removeEvens(ArrayList<Integer> myList) { for (int i = 0; i < myList.size(); i++) { if myList.get(i) % 2 == 0) { myList.remove(i); i - -; } } return myList; }
2D array creation (AP 2021 Qn 4 Part B, AP 2019 Qn 4 Part A, AP 2022 Qn 4 Part A)
Going through a certain row/column (AP 2021 Qn 4 Part A, AP 2019 Qn 4 Part B, AP 2023 Qn 4 Part A)
Go through the entire 2D array
i. Row by Row - Row Major order ( AP 2023 Qn 4 Part B)
ii. Column by Column - Column Major order (AP 2022 Qn 4 Part B)
iii. Row major alternated (AP 2013 Qn 4 Part A)
for(int i =,..........) { if(.....//Searching condition ){ return true; } else { return false; } }
for(int i =,..........) { if(.....//Searching condition ){ return true; } return false; }
© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.