AP Computer Science A

Open in StudyFox Free, no ads. Practice, track progress and quiz yourself in the app.
Java programming from the ground up: objects and methods, conditionals and loops, writing classes, arrays, ArrayLists, 2D arrays, and recursion.
Lessons
- The exam and how to write FRQ code
The exam is 3 hours: a multiple-choice section (90 min) and four free-response questions (90 min) where you write Java methods and classes. A Java Quick…
- Using objects, methods, and Strings
Primitive types: int , double , boolean . Integer division truncates: 7 / 2 is 3 ; 7 % 2 is 1 . Casting: (double) 7 / 2 is 3.5 ; (int) 3.9 is 3 . Objects are…
- Selection and iteration
Boolean logic: && (and), || (or), ! (not). Java uses short-circuit evaluation: in a && b , if a is false, b isn't checked. De Morgan's laws…
- Writing classes
Instance variables are private ; they store each object's state. Constructors have the class name and no return type; they initialize instance variables…
- Arrays and ArrayLists
Arrays have a fixed size: int[] nums = new int[5]; Access with nums[i] ; size is nums.length (no parentheses). ArrayLists resize: ArrayList<String> list…
- 2D arrays and recursion
2D arrays int[][] grid = new int[3][4]; has 3 rows and 4 columns. grid.length is the number of rows; grid[0].length is the number of columns. Traverse with…