Barron's AP Computer Science A [9th, 9 ed.] 9781506272009

151 49 4MB

English Pages 486 [541] Year 2020

Report DMCA / Copyright


Barron's AP Computer Science A [9th, 9 ed.]

Table of contents :
Title Page
About the Author
Barron’s Essential 5
General Information About the Exam
How to Use This Book
Diagnostic Test
Computer Science A Section I
Computer Science A Section II
Answer Key (Section I)
Diagnostic Chart
Answers Explained
1. Strategies for Taking the Exam
The Multiple-Choice Section
What Is Tested?
Time Issues
The Java Quick Reference
An Active Pencil
Troubleshooting—What’s Wrong with This Code?
Loop Tracing
Java Exceptions
Matrix Manipulation
Comparing Algorithms
Mechanics of Answering Questions
The Free-Response Section
What Is the Format?
What Is Tested?
What Types of Questions?
Skill Focus in Free-Response Questions
The Java Quick Reference
Time Issues
Grading the Free-Response Questions
Coding Issues
Maximizing Your Score
2. Introductory Java Language Features
Packages and Classes
Javadoc Comments
Types and Identifiers
Built-in Types
Storage of Numbers
Hexadecimal and Octal Numbers
Final Variables
Arithmetic Operators
Relational Operators
Logical Operators
Assignment Operators
Increment and Decrement Operators
Operator Precedence
Escape Sequences
Control Structures
Decision-Making Control Structures
Errors and Exceptions
Multiple-Choice Questions on Introductory Java Language Features
Answer Key
Answers Explained
3. Classes and Objects
Public, Private, and Static
Types of Methods
Method Overloading
The this Keyword
Reference vs. Primitive Data Types
The Null Reference
Method Parameters
Multiple-Choice Questions on Classes and Objects
Answer Key
Answers Explained
4. Inheritance and Polymorphism
Superclass and Subclass
Inheritance Hierarchy
Implementing Subclasses
Declaring Subclass Objects
Dynamic Binding (Late Binding)
Using super in a Subclass
Type Compatibility
Abstract Classes
Multiple-Choice Questions on Inheritance and Polymorphism
Answer Key
Answers Explained
5. Some Standard Classes
The Object Class
The Universal Superclass
Methods in Object
The String Class
String Objects
Constructing String Objects
The Concatenation Operator
Comparison of String Objects
Other String Methods
Wrapper Classes
The Integer Class
The Double Class
Autoboxing and Unboxing
The Math Class
Random Numbers
Multiple-Choice Questions on Some Standard Classes
Answer Key
Answers Explained
6. Program Design and Analysis
Software Development
Program Specification
Program Design
Program Implementation
Testing and Debugging
Program Maintenance
Object-Oriented Program Design
Identifying Classes
Identifying Behaviors
Determining Relationships Between Classes
UML Diagrams
Implementing Classes
Implementing Methods
Vocabulary Summary
Program Analysis
Program Correctness
Multiple-Choice Questions on Program Design and Analysis
Answer Key
Answers Explained
7. Arrays and Array Lists
One-Dimensional Arrays
Length of Array
Traversing a One-Dimensional Array
Arrays as Parameters
Array Variables in a Class
Array of Class Objects
Analyzing Array Algorithms
Array Lists
The ArrayList Class
The Methods of ArrayList
Autoboxing and Unboxing
Using ArrayList
Two-Dimensional Arrays
Matrix as Array of Row Arrays
Processing a Two-Dimensional Array
Two-Dimensional Array as Parameter
Multiple-Choice Questions on Arrays and Array Lists
Answer Key
Answers Explained
8. Recursion
Recursive Methods
General Form of Simple Recursive Methods
Writing Recursive Methods
Analysis of Recursive Methods
Sorting Algorithms That Use Recursion
Recursive Helper Methods
Recursion in Two-Dimensional Grids
Sample Free-Response Question 1
Sample Free-Response Question 2
Multiple-Choice Questions on Recursion
Answer Key
Answers Explained
9. Sorting and Searching
Sorts: Selection and Insertion Sorts
Selection Sort
Insertion Sort
Recursive Sorts: Merge Sort and Quicksort
Merge Sort
Sorting Algorithms in Java
Sequential Search
Binary Search
Analysis of Binary Search
Multiple-Choice Questions on Sorting and Searching
Answer Key
Answers Explained
10. The AP Computer Science A Labs
The Magpie Lab
Special Emphasis
The Elevens Lab
Special Emphasis
The Picture Lab
Special Emphasis
Multiple-Choice Questions on the Lab Concepts
Answer Key
Answers Explained
Practice Tests
Practice Test 1
Computer Science A Section I
Computer Science A Section II
Answer Key (Section I)
Answers Explained
Practice Test 2
Computer Science A Section I
Computer Science A Section II
Answer Key (Section I)
Answers Explained
Appendix: Glossary of Useful Computer Terms

Polecaj historie