AP Java
Roman Lysecky | Adrian Lizarraga
zyBooks 2017

Table of Contents

1. Introduction to Java
1.1 Programming (general)
1.2 Programming basics
1.3 Comments and whitespace
1.4 Errors and warnings
1.5 Computers and programs (general)
1.6 Computer tour
1.7 Language history
1.8 Problem solving
1.9 Why programming
1.10 Java example: Salary calculation
1.11 Java example: Married-couple names

2. Variables / Assignments
2.1 Variables and assignments (general)
2.2 Variables (int)
2.3 Identifiers
2.4 Arithmetic expressions (general)
2.5 Arithmetic expressions (int)
2.6 Example: Health data
2.7 Floating-point numbers (double)
2.8 Scientific notation for floating-point literals
2.9 Constant variables
2.10 Using math methods
2.11 Integer division and modulo
2.12 Type conversions
2.13 Binary
2.14 Characters
2.15 Strings
2.16 Integer overflow
2.17 Numeric data types
2.18 Random numbers
2.19 Reading API documentation
2.20 Debugging
2.21 Style guidelines
2.22 Java example: Salary calculation with variables
2.23 Java example: Married-couple names with variables

3. Branches
3.1 If-else branches (general)
3.2 If-else
3.3 More if-else
3.4 Equality and relational operators
3.5 Detecting ranges (general)
3.6 Detecting ranges with if-else statements
3.7 Logical operators
3.8 Order of evaluation
3.9 Example: Toll calculation
3.10 Boolean data type
3.11 String comparisons
3.12 Character operations
3.13 String access operations
3.14 More string operations
3.15 Floating-point comparison
3.16 Short circuit evaluation
3.17 Java example: Salary calculation with branches
3.18 Java example: Search for name using branches

4. Loops
4.1 Loops (general)
4.2 While loops
4.3 More while examples
4.4 For loops
4.5 More for loop examples
4.6 Loops and strings
4.7 Nested loops
4.8 Developing programs incrementally
4.9 Break and continue
4.10 Variable name scope
4.11 Java example: Salary calculation with loops
4.12 Java example: Domain name validation with loops

5. Arrays
5.1 Array concept (general)
5.2 Arrays
5.3 Array iteration drill
5.4 Iterating through arrays
5.5 Multiple arrays
5.6 Swapping two variables (General)
5.7 Loop-modifying or copying/comparing arrays
5.8 Debugging example: Reversing an array
5.9 Two-dimensional arrays
5.10 Java example: Salary calculation with arrays
5.11 Java example: Domain name validation with arrays

6. Defined Methods
6.1 User-defined method basics
6.2 Return
6.3 Reasons for defining methods
6.4 Methods with branches/loops
6.5 Unit testing (methods)
6.6 How methods work
6.7 Methods: Common errors
6.8 Array parameters
6.9 Scope of variable/method definitions
6.10 Method name overloading
6.11 Using Scanner in methods
6.12 Perfect size arrays
6.13 Oversize arrays
6.14 Methods with oversize arrays
6.15 Comparing perfect size and oversize arrays
6.16 Java example: Salary calculation with methods
6.17 Java example: Domain name validation with methods

7. Objects and Classes
7.1 Objects: Introduction
7.2 Classes: Introduction
7.3 Mutators, accessors, and private helpers
7.4 Initialization and constructors
7.5 Constructor overloading
7.6 Unit testing (classes)
7.7 Objects and references
7.8 The ‘this’ implicit parameter
7.9 Abstract data types: Introduction
7.10 Primitive and reference types
7.11 ArrayList
7.12 Classes, ArrayLists, and methods: A seat reservation example
7.13 Classes with classes
7.14 ArrayList ADT
7.15 Parameters of reference types
7.16 Java example: Salary calculation with classes
7.17 Java example: Domain name availability with classes

8. Inheritance
8.1 Derived classes
8.2 Access by members of derived classes
8.3 Overriding member methods
8.4 The Object class
8.5 Polymorphism
8.6 ArrayLists of Objects
8.7 Is-a versus has-a relationships
8.8 Java example: Employees and overriding class methods

9. Abstract Class and Interfaces
9.1 Abstract classes: Introduction
9.2 Abstract classes
9.3 UML for abstract classes
9.4 Abstract classes and polymorphism
9.5 Interfaces
9.6 Java example: Employees and instantiating from an abstract class

10. Recursion
10.1 Recursion: Introduction
10.2 Recursive methods
10.3 Recursive algorithm: Search
10.4 Adding output statements for debugging
10.5 Creating a recursive method
10.6 Recursive math methods
10.7 Recursive exploration of all possibilities
10.8 Stack overflow
10.9 Java example: Recursively output permutations

11. Exceptions
11.1 Exception basics
11.2 Exceptions with methods
11.3 Multiple handlers
11.4 Exception handling in file input/output
11.5 Java example: Generate number format exception

12. Searching and Sorting Alg.
12.1 Searching and algorithms (Java)
12.2 Binary search (Java)
12.3 O notation
12.4 Algorithm analysis
12.5 Sorting: Introduction
12.6 Selection sort (Java)
12.7 Insertion sort (Java)
12.8 Quicksort (Java)
12.9 Merge sort (Java)

13. AP Java: Strings
13.1 String operations problem
13.2 Black and white problem
13.3 String search problem
13.4 Palindrome problem
13.5 Sentence splitter problem
13.6 Sentence manager problem

14. AP Java: Arrays
14.1 Array madness problem
14.2 Encryption problem
14.3 Number changer problem
14.4 Daily quizzes problem

15. AP Java: 2D Arrays
15.1 Array checker problem
15.2 Array words problem
15.3 Dice game problem
15.4 FillerUp problem
15.5 Map reader problem

16. AP Java: ArrayList
16.1 Baseball player problem
16.2 Flight schedule problem
16.3 Friends problem
16.4 The office problem
16.5 Help, I’m trapped! problem
16.6 Phone contacts problem
16.7 Gamer bug problem

17. AP Java: Numbers
17.1 Flip flop problem
17.2 Array MinMax problem
17.3 Number properties problem
17.4 Nuts and bolts problem
17.5 Time gaps problem
17.6 Random dice problem

18. AP Java: Classes
18.1 Magazine problem
18.2 Map problem
18.3 Music song problem
18.4 Rectangle problem

19. AP Java: Inheritence
19.1 Cat problem
19.2 Shapes problem
19.3 Secrets problem

20. Memory Management
20.1 Introduction to memory management
20.2 A first linked list
20.3 Memory regions: Heap/Stack
20.4 Basic garbage collection
20.5 Garbage collection and variable scope
20.6 Java example: Employee list using ArrayLists

21. Input / Output
21.1 OutputStream and System.out
21.2 InputStream and System.in
21.3 Output formatting
21.4 Streams using Strings
21.5 File input and output

22. Generics
22.1 Comparable Interface: Sorting an ArrayList
22.2 Generic methods
22.3 Class generics
22.4 Java example: Map values using a generic method

23. Collections
23.1 Enhanced for loop
23.2 List: LinkedList
23.3 Map: HashMap
23.4 Set: HashSet
23.5 Queue interface
23.6 Deque interface

24. GUI
24.1 Basic graphics
24.2 Introduction to graphical user interfaces
24.3 Positioning GUI components using a GridBagLayout
24.4 GUI input and ActionListeners
24.5 GUI input with formatted text fields
24.6 GUI input with JSpinners
24.7 Displaying multi-line text in a JTextArea
24.8 Using tables in GUIs
24.9 Using sliders in GUIs
24.10 GUI tables, fields, and buttons: A seat reservation example
24.11 Reading files with a GUI

25. JavaFX
25.1 Introduction to graphical user interfaces with JavaFX
25.2 Positioning GUI components using a GridPane
25.3 Input and event handlers
25.4 Basic graphics with JavaFX

26. Additional Material
26.1 Switch statements
26.2 Conditional expressions
26.3 Do-while loops
26.4 Enumerations
26.5 Engineering examples
26.6 Engineering examples using methods
26.7 Command-line arguments
26.8 Command-line arguments and files
26.9 Java documentation for methods
26.10 Java documentation for classes
26.11 Additional practice: Output art
26.12 Additional practice: Grade calculation
26.13 Additional practice: Tweet decoder
26.14 Additional practice: Dice statistics
26.15 zyBooks built-in programming window