This book is now obsolete Please use CSAwesome instead.
Java Review for the AP CS A Exam¶
Assignments¶
Table of Contents¶
- 1. Preface and Getting Setup
- 2. Java Basics: Classes and Objects
- 3. Variables
- 3.1. What is a Variable?
- 3.2. Declaring Variables in Java
- 3.3. Changing Variables in Java
- 3.4. Naming Variables
- 3.5. Operators
- 3.6. Casting Variables
- 3.7. Integer Min and Max
- 3.8. Random Numbers
- 3.9. Common Mistakes
- 3.10. Easy Multiple Choice Questions
- 3.11. Medium Multiple Choice Questions
- 3.12. Hard Multiple Choice Questions
- 3.13. Variables - Summary
- 3.14. Code Practice with Variables
- 3.15. Mixed Up Code Practice
- 4. Strings
- 4.1. What is a String?
- 4.2. Declaring and Creating Strings
- 4.3. String Methods on the Exam
- 4.4. String Equality
- 4.5. String Operators - Concatenation
- 4.6. Common Mistakes
- 4.7. More Practice
- 4.8. Easy Multiple Choice Questions
- 4.9. Medium Multiple Choice Questions
- 4.10. Hard Multiple Choice Questions
- 4.11. Strings - Summary
- 4.12. Code Practice with Strings
- 4.13. Mixed Up Code Practice
- 5. Conditionals
- 5.1. Conditionals
- 5.2. Three or More Options
- 5.3. Complex Conditionals
- 5.4. Short Circuit Evaluation
- 5.5. DeMorgan’s Laws
- 5.6. Common Mistakes
- 5.7. More Practice
- 5.8. Easy Multiple Choice Questions
- 5.9. Medium Multiple Choice Questions
- 5.10. Hard Multiple Choice Questions
- 5.11. Free Response - Time
- 5.12. Conditional - Summary
- 5.13. Code Practice with Conditionals
- 5.14. Mixed Up Code Practice
- 6. Magpie Chatbot Lab
- 6.1. Lab Requirement
- 6.2. Magpie Lab
- 6.3. Activity 1: Exploring Chatbots
- 6.4. Keywords
- 6.5. Activity 2: Running Simplified Magpie Code
- 6.6. Exercises
- 6.7. Activity 2: Actual Code - (Optional)
- 6.8. Activity 3: Better Keyword Detection
- 6.9. Activity 4: Responses that Transform Statements
- 6.10. Mixed Up Code Practice
- 7. Loops
- 7.1. Loops in Java
- 7.2. While Loops
- 7.3. For Loops
- 7.4. Nested For Loops
- 7.5. Common Mistakes
- 7.6. More Practice
- 7.7. Easy Multiple Choice Questions
- 7.8. Medium Multiple Choice Questions
- 7.9. Hard Multiple Choice Questions
- 7.10. Free Response Questions
- 7.11. Loops - Summary
- 7.12. Code Practice with Loops
- 7.13. Mixed Up Code Practice
- 8. Arrays
- 8.1. Arrays in Java
- 8.2. Looping with the For-Each Loop
- 8.3. Using a For Loop to Loop Through an Array
- 8.4. Looping From Back to Front
- 8.5. Looping through Part of an Array
- 8.6. Things to Watch For When Looping Through an Array
- 8.7. Common Mistakes
- 8.8. More Practice
- 8.9. Easy Multiple Choice Questions
- 8.10. Medium Multiple Choice Questions
- 8.11. Hard Multiple Choice Questions
- 8.12. Practice Exam for Arrays
- 8.13. Free Response Questions
- 8.14. Arrays - Summary
- 8.15. Code Practice with Arrays
- 8.16. Mixed Up Code Practice
- 9. List and ArrayList
- 9.1. Lists
- 9.2. The List Interface
- 9.3. What is an Interface?
- 9.4. Interfaces are like Contracts
- 9.5. List Methods on the Exam
- 9.6. Why Use a List?
- 9.7. The ArrayList Class
- 9.8. The Import Statement
- 9.9. Declaring Lists
- 9.10. Creating Lists
- 9.11. Adding Values to a List
- 9.12. Getting and Setting Values in a List
- 9.13. Removing an Object at an Index
- 9.14. Looping Through a List
- 9.15. Comparing Arrays and Lists
- 9.16. Common Mistakes
- 9.17. More Practice
- 9.18. Easy Multiple Choice Questions
- 9.19. Medium Multiple Choice Questions
- 9.20. Hard Multiple Choice Questions
- 9.21. Free Response Questions
- 9.21.1. Free Response - String Scramble B
- 9.21.2. Free Response - Climbing Club A
- 9.21.3. Free Response - Climbing Club B
- 9.21.4. Free Response - Climbing Club C
- 9.21.5. Free Response - CookieOrder A
- 9.21.6. Free Response - CookieOrder B
- 9.21.7. Free Response - StringFormatter A
- 9.21.8. Free Response - StringFormatter B
- 9.22. List - Summary
- 9.23. Code Practice with ArrayLists
- 9.24. Mixed Up Code Practice
- 10. Two-dimensional Arrays
- 10.1. Introduction to 2D Arrays
- 10.2. Array Storage
- 10.3. Declaring 2D Arrays
- 10.4. Set Value(s) in a 2D Array
- 10.5. Get a Value from a 2D Array
- 10.6. Getting the Number of Rows and Columns
- 10.7. Looping Through a 2D Array
- 10.8. Use a For-Each to Loop Through an Array
- 10.9. Loop Through Part of a 2D Array
- 10.10. Common Mistakes
- 10.11. More Practice
- 10.12. Easy Multiple Choice Questions
- 10.13. Medium Multiple Choice Questions
- 10.14. Hard Multiple Choice Questions
- 10.15. Free Response Questions
- 10.16. 2d Arrays - Summary
- 10.17. Code Practice with 2D Arrays
- 10.18. Mixed Up Code Practice
- 11. Object-Oriented Concepts
- 11.1. Object-Oriented Programming Concepts
- 11.2. Objects and Classes
- 11.3. Inheritance
- 11.4. Specifying the Parent Class
- 11.5. Why Use Inheritance?
- 11.6. Association vs Inheritance
- 11.7. The Equals Method
- 11.8. Overriding vs Overloading
- 11.9. Using Super to call an Overridden Method
- 11.10. Access to Inherited Private Fields
- 11.11. Inheritance and Constructors
- 11.12. Abstract Classes
- 11.13. Inheritance and Interfaces
- 11.14. The Comparable Interface
- 11.15. Polymorphism
- 11.16. Common Mistakes
- 11.17. More Practice
- 11.18. Easy Multiple Choice Questions
- 11.19. Medium Multiple Choice Questions
- 11.20. Hard Multiple Choice Questions
- 11.21. Free Response Questions
- 11.22. Object-Oriented Summary
- 11.23. Code Practice with Object Oriented Concepts
- 11.24. Mixed Up Code Practice
- 12. Recursion
- 12.1. Recursion
- 12.2. What is Recursion?
- 12.3. Why use Recursion?
- 12.4. Tracing Recursive Methods
- 12.5. Common Mistakes
- 12.6. Base Case Practice
- 12.7. Trace Practice
- 12.8. Try Writing a Recursive Method
- 12.9. Easy Multiple Choice Questions
- 12.10. Medium Multiple Choice Questions
- 12.11. Hard Multiple Choice Questions
- 12.12. Mixed Up Code Practice
- 12.13. Recursion Summary
- 12.14. Code Practice for Recursion
- 12.15. Recursion More Mixed Up Code Practice
- 13. Searching and Sorting
- 14. Preparing for the Exam
- 15. Timed Multiple-Choice Exams
- 16. Free Response Practice Exam
- 16.1. RandomStringChooser - Part A
- 16.2. RandomStringChooser - Part B
- 16.3. StringCoder - Part A
- 16.4. StringCoder - Part B
- 16.5. StudentAnswerSheet - Part A
- 16.6. StudentAnswerSheet - Part B
- 16.7. SkyView - Part A
- 16.8. SkyView - Part B
- 16.9. Hidden Word - Write Class
- 16.10. ArrayTester - Part A
- 16.11. ArrayTester - Part B
- 16.12. NumberGroup - Part A
- 16.13. NumberGroup - Part B
- 16.14. NumberGroup - Part C
- 16.15. Exercises
- 17. Mixed Up Code - Free Response Practice
- 18. Working with Images
- 19. Turtles - Intro to Objects and Methods
Appendix 1¶
Indices¶
You have attempted of activities on this page