Zybook 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: Married-couple names 1.11 zyLab training: Basics 1.12 zyLab training: Interleaved input / output 1.13 LAB: Formatted output: Hello World! 1.14 LAB: Formatted output: No parking sign 1.15 LAB: Input and formatted output: House real estate summary 1.16 LAB: Input and formatted output: Right-facing arrow 1.17 LAB: Warm up: Hello world 1.18 LAB: Warm up: Basic output with variables 1.19 LAB*: Program: ASCII art 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 2.23 Java example: Salary calculation with variables 2.24 Java example: Married-couple names with variables 2.25 LAB: Divide by x 2.26 LAB: Caffeine levels 2.27 LAB: Driving costs 2.28 LAB: Expression for calories burned during workout 2.29 LAB: Using math methods 2.30 LAB: Phone number breakdown 2.31 LAB: Simple statistics 2.32 LAB: Musical note frequencies 2.33 LAB: Welcome message 2.34 LAB: Mad Lib 2.35 LAB: Warm up: Variables, input, and casting 2.36 LAB*: Program: Painting a wall 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 Example: Toll calculation 3.9 Order of evaluation 3.10 Switch statements 3.11 Boolean data type 3.12 String comparisons 3.13 String access operations 3.14 Character operations 3.15 More string operations 3.16 Conditional expressions 3.17 Floating-point comparison 3.18 Short circuit evaluation 3.19 Java example: Salary calculation with branches 3.20 Java example: Search for name using branches 3.21 LAB: Remove gray from RGB 3.22 LAB: Largest number 3.23 LAB: Interstate highway numbers 3.24 LAB: Seasons 3.25 LAB: Exact change 3.26 LAB: Leap Year 3.27 LAB: Name format 3.28 LAB: Warm up: Text message abbreviation decoder 3.29 LAB*: Program: Text message decoder 3.30 LAB*: Program: Text message expander 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 Enumerations 4.12 Java example: Salary calculation with loops 4.13 Java example: Domain name validation with loops 4.14 LAB: Convert to binary 4.15 LAB: Mad Lib - loops 4.16 LAB: Varied amount of input data 4.17 LAB: Count characters 4.18 LAB: Checker for integer string 4.19 LAB: Password modifier 4.20 LAB: Remove spaces 4.21 LAB: Count input length without spaces, periods, or commas 4.22 LAB: Countdown until matching digits 4.23 LAB: Output range with increment of 10 4.24 LAB: Print string in reverse 4.25 LAB: Palindrome 4.26 LAB: Brute force equation solver 4.27 LAB: Warm up: Drawing a right triangle 4.28 LAB*: Program: Drawing a half arrow 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 Enhanced for loop: Arrays 5.11 Java example: Annual salary tax rate calculation with arrays 5.12 Java example: Domain name validation with arrays 5.13 LAB: Output numbers in reverse 5.14 LAB: Middle item 5.15 LAB: Output values below an amount 5.16 LAB: Adjust list by normalizing 5.17 LAB: Word frequencies 5.18 LAB: Contains the character 5.19 LAB: Elements in a range 5.20 LAB: Two smallest numbers 5.21 LAB: Warm up: People's weights 5.22 LAB*: Program: Soccer team roster 6. User-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 Parameter error checking 6.12 Using Scanner in methods 6.13 Perfect size arrays 6.14 Oversize arrays 6.15 Methods with oversize arrays 6.16 Comparing perfect size and oversize arrays 6.17 Using references in methods 6.18 Returning arrays from methods 6.19 Common errors: Methods and arrays 6.20 Java documentation for methods 6.21 Java example: Salary calculation with methods 6.22 Java example: Domain name validation with methods 6.23 LAB: Miles to track laps 6.24 LAB: Step counter 6.25 LAB: A jiffy 6.26 LAB: Driving cost - methods 6.27 LAB: Swapping variables 6.28 LAB: Max magnitude 6.29 LAB: Flip a coin 6.30 LAB: Count characters - methods 6.31 LAB: Remove spaces - methods 6.32 LAB: Convert to binary - methods 6.33 LAB: Max and min numbers 6.34 LAB: Acronyms 6.35 LAB: Leap year - methods 6.36 LAB: Exact change - methods 6.37 LAB: Even/odd values in an array 6.38 LAB: Contact list 6.39 LAB: Sort an array 6.40 LAB: Output values below an amount - methods 6.41 LAB: Adjust list by normalizing - methods 6.42 LAB: Word frequencies - methods 6.43 LAB: Replacement words 6.44 LAB: Warm up: Text analyzer & modifier 6.45 LAB*: Program: Authoring assistant 7. Objects and Classes 7.1 Objects: Introduction 7.2 Using a class 7.3 Defining a class 7.4 Mutators, accessors, and private helpers 7.5 Initialization and constructors 7.6 Choosing classes to create 7.7 Defining main() in a programmer-defined class 7.8 Unit testing (classes) 7.9 Constructor overloading 7.10 Objects and references 7.11 The 'this' implicit parameter 7.12 Primitive and reference types 7.13 Wrapper class conversions 7.14 ArrayList 7.15 Classes, ArrayLists, and methods: A seat reservation example 7.16 ArrayList ADT 7.17 Java documentation for classes 7.18 Parameters of reference types 7.19 Static fields and methods 7.20 Using packages 7.21 Java example: Salary calculation with classes 7.22 Java example: Domain name availability with classes 7.23 LAB*: Warm up: Online shopping cart (Part 1) 7.24 LAB*: Program: Online shopping cart (Part 2) 8. Memory Management 8.1 Introduction to memory management 8.2 A first linked list 8.3 Memory regions: Heap/Stack 8.4 Basic garbage collection 8.5 Garbage collection and variable scope 8.6 Java example: Employee list using ArrayLists 8.7 LAB: Warm up: Contacts 8.8 LAB*: Program: Playlist 9. Input / Output 9.1 OutputStream and System.out 9.2 InputStream and System.in 9.3 Output formatting 9.4 Streams using Strings 9.5 File input and output 9.6 LAB: Warm up: Parsing strings 9.7 LAB*: Program: Data visualization 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. Recursion 12.1 Recursion: Introduction 12.2 Recursive methods 12.3 Recursive algorithm: Search 12.4 Adding output statements for debugging 12.5 Creating a recursive method 12.6 Recursive math methods 12.7 Recursive exploration of all possibilities 12.8 Stack overflow 12.9 Java example: Recursively output permutations 13. Exceptions 13.1 Exception basics 13.2 Exceptions with methods 13.3 Multiple handlers 13.4 Exception handling in file input/output 13.5 Java example: Generate number format exception 14. Generics 14.1 Comparable Interface: Sorting an ArrayList 14.2 Generic methods 14.3 Class generics 14.4 Java example: Map values using a generic method 15. Collections 15.1 Enhanced for loop 15.2 List: LinkedList 15.3 Map: HashMap 15.4 Set: HashSet 15.5 Queue interface 15.6 Deque interface 16. GUI 16.1 Basic graphics 16.2 Introduction to graphical user interfaces 16.3 Positioning GUI components using a GridBagLayout 16.4 GUI input and ActionListeners 16.5 GUI input with formatted text fields 16.6 GUI input with JSpinners 16.7 Displaying multi-line text in a JTextArea 16.8 Using tables in GUIs 16.9 Using sliders in GUIs 16.10 GUI tables, fields, and buttons: A seat reservation example 16.11 Reading files with a GUI 17. JavaFX 17.1 Introduction to graphical user interfaces with JavaFX 17.2 Positioning GUI components using a GridPane 17.3 Input and event handlers 17.4 Basic graphics with JavaFX 18. Searching and Sorting Algorithms 18.1 Searching and algorithms 18.2 Binary search 18.3 O notation 18.4 Algorithm analysis 18.5 Sorting: Introduction 18.6 Selection sort 18.7 Insertion sort 18.8 Quicksort 18.9 Merge sort 19. Additional Material 19.1 Do-while loops 19.2 Engineering examples 19.3 Engineering examples using methods 19.4 Command-line arguments 19.5 Command-line arguments and files 19.6 Additional practice: Output art 19.7 Additional practice: Grade calculation 19.8 Additional practice: Tweet decoder 19.9 Additional practice: Dice statistics 19.10 zyBooks built-in programming window