Programming in Java (Early Objects)
Roman Lysecky | Adrian Lizarraga
zyBooks 2017

Table of Contents

1. Introduction to Java
1.1 Programming
1.2 A first program
1.3 Basic output
1.4 Basic input
1.5 Errors and warnings
1.6 Computers and programs
1.7 Computer tour
1.8 Language history
1.9 Problem solving
1.10 Java example: Salary calculation
1.11 Java example: Married-couple names

2. Basic Objects
2.1 Objects: An early introduction
2.2 Variables (int)
2.3 Assignments
2.4 Identifiers
2.5 Arithmetic expressions (int)
2.6 Floating-point numbers (double)
2.7 Comments and whitespace
2.8 Calling methods
2.9 Constructing objects
2.10 Accessors and mutators
2.11 Reading API documentation
2.12 Debugging
2.13 Basic graphics
2.14 Style guidelines
2.15 Java example: Salary calculation with variables

3. Basic Methods + Classes
3.1 Classes: Introduction
3.2 User-defined method basics
3.3 Parameters
3.4 Return
3.5 Reasons for defining methods
3.6 Unit testing (classes)
3.7 The ‘this’ implicit parameter
3.8 Java documentation for classes

4. Data Types
4.1 Constant variables
4.2 Using math methods
4.3 Type conversions
4.4 Binary
4.5 Characters
4.6 String basics
4.7 Integer overflow
4.8 Numeric data types
4.9 Random numbers
4.10 Java example: Married-couple names with variables

5. Branches
5.1 If-else
5.2 Relational and equality operators
5.3 Multiple if-else branches
5.4 Logical operators
5.5 Switch statements
5.6 Boolean data types
5.7 String comparisons
5.8 String access operations
5.9 String modify operations
5.10 Character operations
5.11 Conditional expressions
5.12 Floating-point comparison
5.13 Short circuit evaluation
5.14 Java example: Salary calculation with branches
5.15 Java example: Search for name using branches

6. Loops
6.1 Loops
6.2 While loops
6.3 More while examples
6.4 Counting
6.5 For loops
6.6 Nested loops
6.7 Developing programs incrementally
6.8 Break and continue
6.9 Variable name scope
6.10 Enumerations
6.11 Java example: Salary calculation with loops
6.12 Java example: Domain name validation with loops

7. Arrays
7.1 Array concept
7.2 Arrays
7.3 Array iteration drill
7.4 Iterating through arrays
7.5 Multiple arrays
7.6 Swapping two variables
7.7 Loop-modifying or copying/comparing arrays
7.8 Debugging example: Reversing an array
7.9 Two-dimensional arrays
7.10 Java example: Salary calculation with arrays
7.11 Java example: Domain name validation with arrays

8. Methods Continued
8.1 Methods with branches/loops
8.2 Unit testing (methods)
8.3 How methods work
8.4 Methods: Common errors
8.5 Array parameters
8.6 Scope of variable/method definitions
8.7 Method name overloading
8.8 Java documentation for methods
8.9 Java example: Salary calculation with methods
8.10 Java example: Domain name validation with methods

9. Classes continued
9.1 Mutators, accessors, and private helpers
9.2 Constructors
9.3 Constructor overloading
9.4 Objects and references
9.5 Abstract data types: Introduction
9.6 Primitive and reference types
9.7 ArrayList
9.8 Classes, ArrayLists, and methods: A seat reservation example
9.9 Classes with classes
9.10 ArrayList ADT
9.11 Parameters of reference types
9.12 Java example: Salary calculation with classes
9.13 Java example: Domain name availability with classes

10. Inheritance
10.1 Derived classes
10.2 Access by members of derived classes
10.3 Overriding member methods
10.4 The Object class
10.5 Polymorphism
10.6 ArrayLists of Objects
10.7 Is-a versus has-a relationships
10.8 Java example: Employees and overriding class methods

11. Abstract Class and Interfaces
11.1 Abstract classes: Introduction
11.2 Abstract classes
11.3 UML for abstract classes
11.4 Abstract classes and polymorphism
11.5 Interfaces
11.6 Java example: Employees and instantiating from an abstract class

12. Generics
12.1 Comparable Interface: Sorting an ArrayList
12.2 Generic methods
12.3 Class generics
12.4 Java example: Map values using a generic method

13. Collections
13.1 Enhanced for loop
13.2 Map: HashMap
13.3 Set: HashSet
13.4 List: LinkedList
13.5 Queue interface
13.6 Deque interface

14. GUI
14.1 Introduction to graphical user interfaces
14.2 Positioning GUI components using a GridBagLayout
14.3 GUI input and ActionListeners
14.4 GUI input with formatted text fields
14.5 GUI input with JSpinners
14.6 Displaying multi-line text in a JTextArea
14.7 Using tables in GUIs
14.8 Using sliders in GUIs
14.9 GUI tables, fields, and buttons: A seat reservation example
14.10 Reading files with a GUI

15. JavaFX
15.1 Introduction to graphical user interfaces with JavaFX
15.2 Positioning GUI components using a GridPane
15.3 Input and event handlers
15.4 Basic graphics with JavaFX

16. Input / Output
16.1 OutputStream and System.out
16.2 InputStream and System.in
16.3 Output formatting
16.4 Streams using Strings
16.5 File input and output

17. Exceptions
17.1 Exception basics
17.2 Exceptions with methods
17.3 Multiple handlers
17.4 Exception handling in file input/output
17.5 Java example: Generate number format exception

18. Recursion
18.1 Recursion: Introduction
18.2 Recursive methods
18.3 Recursive algorithm: Search
18.4 Adding output statements for debugging
18.5 Creating a recursive method
18.6 Recursive math methods
18.7 Recursive exploration of all possibilities
18.8 Stack overflow
18.9 Java example: Recursively output permutations

19. Memory Management
19.1 Introduction to memory management
19.2 A first linked list
19.3 Memory regions: Heap/Stack
19.4 Basic garbage collection
19.5 Garbage collection and variable scope
19.6 Java example: Employee list using ArrayLists

20. Additional Material
20.1 Do-while loops
20.2 Engineering examples
20.3 Engineering examples using methods
20.4 Command-line arguments
20.5 Command-line arguments and files
20.6 Additional practice: Output art
20.7 Additional practice: Grade calculation
20.8 Additional practice: Health data
20.9 Additional practice: Tweet decoder
20.10 Additional practice: Dice statistics
20.11 zyBooks built-in programming window