Unit 0 Introduction: About This Course¶
Unit 1 Inheritance and Polymorphism¶
- 1.1. Getting Started
- 1.1.1. Introducing LightBot
- 1.1.2. From LightBot to Micro Worlds
- 1.1.3. Self Check: Micro-Worlds
- 1.1.4. A Bit More LightBot
- 1.1.5. Textually Representing Programs
- 1.1.6. Self-Check: Turning Micro-Worlds into Code
- 1.1.7. What Does LightBot Say About Programming?
- 1.1.8. A Programmable LightBot in Java
- 1.1.9. Syntax Practice 1a
- 1.1.10. Creating New Objects
- 1.1.11. Calling Methods on an Object
- 1.1.12. Putting it All Together
- 1.1.13. A Word on Making Code Easy to Read
- 1.1.14. Syntax Practice 1b
- 1.1.15. Programming Practice 1
- 1.1.16. Check Your Understanding
- 1.2. Unit 1 Lab 1 Placeholder
- 1.3. Inheritance and Polymorphism: Subclasses and Methods
- 1.3.1. The Jeroos of Santong Island
- 1.3.2. Class Hierarchy and Inheritance
- 1.3.3. Summarizing: What is Inheritance?
- 1.3.4. Syntax Practice 2a: Jeroo Methods
- 1.3.5. Problem Solving and Algorithms
- 1.3.6. Creating and Using Jeroo Methods
- 1.3.7. What is Polymorphism?
- 1.3.8. Syntax Practice 2b: Subclass Constructors
- 1.3.9. Syntax Practice 2c: More Subclass Constructors
- 1.3.10. Programming Practice 2
- 1.3.11. Check Your Understanding
- 1.4. Unit 1 Lab 2 Placeholder
Unit 2 Conditionals and Software Testing¶
- 2.1. Conditional and Repeating Actions
- 2.1.1. Selection
- 2.1.2. Conditions Using Sensor Methods
- 2.1.3. An Overview of Conditional Statements
- 2.1.4. Java’s Syntax for the If-Then-Else Structure
- 2.1.5. Syntax Practice 3a: If-Then-Else
- 2.1.6. Creating Optional Statements With If-then
- 2.1.7. Java’s Syntax for the If-then Structure
- 2.1.8. Syntax Practice 3b: If-Then
- 2.1.9. Java’s Syntax for the Multi-way Selection Structure (a cascaded if)
- 2.1.10. Syntax Practice 3c: Multi-way If
- 2.1.11. Compound Conditions
- 2.1.12. Syntax Practice 3d: Compound Conditions
- 2.1.13. Repeating Actions
- 2.1.14. Generic Repetition Structures
- 2.1.15. Java’s Syntax for the While Loop
- 2.1.16. Syntax Practice 3e: While Loops
- 2.1.17. Programming Practice 3
- 2.1.18. Check Your Understanding
- 2.2. Unit 2 Lab 1 Placeholder
- 2.3. Software Testing
- 2.3.1. What Is Software Testing?
- 2.3.2. Writing Your First Software Test
- 2.3.3. Check Your Understanding: Software Testing Concepts
- 2.3.4. More About Methods
- 2.3.5. Check Your Understanding: Method Signatures
- 2.3.6. Check Your Understanding: Methods with Parameters
- 2.3.7. Good Habits for Conditionals
- 2.3.8. A Different Type of Complex If-Statement
- 2.3.9. Short Circuit Evaluation
- 2.3.10. Check Your Understanding: Logical Equivalence
- 2.3.11. Syntax Practice 4a: Compound Conditionals
- 2.3.12. Syntax Practice 4b: Conditionals and Relational Operators
- 2.3.13. Programming Practice 4
- 2.3.14. Module Review
- 2.4. Unit 2 Lab 2 Placeholder
Unit 3 Variables and For-each Loops¶
- 3.1. Variables, Fields, and Parameters
- 3.1.1. Variables
- 3.1.2. Check Your Understanding: Variables
- 3.1.3. Fields Versus Local Variables
- 3.1.4. Changing Private Variables: Mutator Methods
- 3.1.5. Check your Understanding: Scope
- 3.1.6. Accessor Methods
- 3.1.7. Check Your Understanding: Fields, Getters and Setters
- 3.1.8. Syntax Practice 5a: Fields and Accessors
- 3.1.9. The Return Keyword
- 3.1.10. Check your Understanding: Typed Methods and Return Statements
- 3.1.11. Syntax Practice 5b: Mutators and Return Statements
- 3.1.12. Using Fields in Testing
- 3.1.13. Programming Practice 5a
- 3.1.14. Programming Practice 5b
- 3.2. Unit 3 Lab 1 Placeholder
- 3.3. Pictures and For-each Loops
- 3.4. Unit 4 Lab 2 Placeholder
Unit 4 More Lists, Loops, Arrays and Grouping¶
- 4.1. Aggregation, Strings and More Loops
- 4.1.1. Object-Oriented Design: Aggregation, Composition, and Delegation
- 4.1.2. Strings and Characters
- 4.1.3. Check Your Understanding: Strings
- 4.1.4. Counter-controlled Loops
- 4.1.5. Check Your Understanding: Counter Controlled Loops
- 4.1.6. Tips on Random Numbers
- 4.1.7. Check Your Understanding: Random Numbers
- 4.1.8. Method Overriding
- 4.1.9. Check Your Understanding: Method Overriding
- 4.1.10. Syntax Practice 7a: For Loops and OO Design
- 4.1.11. Syntax Practice 7b: toString and Returning Values
- 4.1.12. Programming Practice 7a
- 4.1.13. Programming Practice 7b
- 4.2. Unit 4 Lab 1 Placeholder
- 4.3. Grouping Objects Using Lists and Nested For Loops
- 4.3.1. Collections of Objects
- 4.3.2. Interfaces
- 4.3.3. Check Your Understanding: Interfaces
- 4.3.4. Syntax Practice 8a: Strings
- 4.3.5. The List Interface
- 4.3.6. Generics
- 4.3.7. ArrayList
- 4.3.8. Check Your Understanding: ArrayLists
- 4.3.9. Syntax Practice 8b: Lists
- 4.3.10. Nested For Loops
- 4.3.11. Check Your Understanding: Nested For Loops
- 4.3.12. Syntax Practice 8c: Nested Loops
- 4.3.13. Check Your Understanding
- 4.3.14. Programming Practice 8a
- 4.3.15. Programming Practice 8b
- 4.4. Unit 4 Lab 2 Placeholder
Unit 5 More Loops and Arrays¶
- 5.1. Lists, Loop Idioms, Generics, and the Null Keyword
- 5.1.1. Modelling the Contents of a Library
- 5.1.2. Looping Idioms
- 5.1.3. Check Your Understanding: Loop Idioms
- 5.1.4. Syntax Practice 9a: Loop Idioms
- 5.1.5. Generics Revisited
- 5.1.6. Check Your Understanding: Generics
- 5.1.7. Syntax Practice 9b: Generics
- 5.1.8. The Null Keyword
- 5.1.9. Diagnosing a Null Pointer Exception
- 5.1.10. Check Your Understanding: Null
- 5.1.11. Using BlueJ’s Debugger
- 5.1.12. Using BlueJ’s Code Pad
- 5.1.13. Programming Practice 9a: Loop Idioms
- 5.1.14. Programming Practice 9b: Loops and Generics
- 5.2. Unit 5 Lab 1 Placeholder
- 5.3. Arrays
- 5.3.1. Creating An Array
- 5.3.2. Accessing Items in Arrays
- 5.3.3. Setting Items in an Array
- 5.3.4. Arrays Compared to Lists (or ArrayList)
- 5.3.5. Putting It All Together
- 5.3.6. Check Your Understanding: Arrays
- 5.3.7. Syntax Practice 10a
- 5.3.8. Iterating Over Arrays
- 5.3.9. Check Your Understanding: Iterating with Arrays
- 5.3.10. Syntax Practice 10b
- 5.3.11. Initializing Array Contents
- 5.3.12. Printing Arrays
- 5.3.13. Copying Array Variables
- 5.3.14. Naming Array Variables
- 5.3.15. Writing Test Assertions Involving Arrays
- 5.3.16. Applying Arrays in a Problem
- 5.3.17. Syntax Practice 10c
- 5.3.18. Check Your Understanding
- 5.3.19. Programming Practice 10a
- 5.3.20. Programming Practice 10b
- 5.4. Unit 5 Lab 2 Placeholder
Unit 6 Multi-Dimensional Arrays, File I/O and Sets¶
- 6.1. Multi-dimensional Arrays
- 6.1.1. Dimensions in an Array
- 6.1.2. Check Your Understanding: 2D Arrays
- 6.1.3. Syntax Practice: 2D Array Basics
- 6.1.4. Iterating through a 2D Array
- 6.1.5. Check Your Understanding: Iterating with 2D Arrays
- 6.1.6. Syntax Practice: Looping Over 2D Arrays
- 6.1.7. Multi-Dimensional Arrays
- 6.1.8. Syntax Practice: 3D Arrays
- 6.1.9. But Can You Have Multi-dimensional Lists?
- 6.1.10. Integer Division and Modulus
- 6.1.11. Check Your Understanding: Modulus
- 6.1.12. Syntax Practice: Modulus
- 6.1.13. Programming Practice: Multi-dimensional Arrays
- 6.1.14. Programming Practice: Mod
- 6.2. Unit 6 Lab 1 Placeholder
- 6.3. Variable Scoping, Input, and Output
- 6.3.1. Variable Scoping
- 6.3.2. Summarizing Scope Concepts
- 6.3.3. Check Your Understanding: Scope
- 6.3.4. Syntax Practice: Scoping
- 6.3.5. Java Input and Output
- 6.3.6. Output Using PrintWriters
- 6.3.7. Check Your Understanding: Output
- 6.3.8. Input Using Scanners
- 6.3.9. A Complete Input Example
- 6.3.10. Check Your Understanding: Input
- 6.3.11. A Complete Input/Output Example
- 6.3.12. Testing I/O-based Operations
- 6.3.13. Check Your Understanding: Testing
- 6.4. Unit 6 Lab 2 Placeholder
- 6.5. Maps and Sets
- 6.5.1. The Map and Set Interfaces
- 6.5.2. The Map Interface
- 6.5.3. Syntax Practice: Making Maps
- 6.5.4. Adding and Accessing Pairs in a Map
- 6.5.5. Syntax Practice: Adding to Maps
- 6.5.6. Checking for and Removing Pairs in a Map
- 6.5.7. A Visual Summary of Using Map and HashMap
- 6.5.8. Syntax Practice: Map Contains and Remove
- 6.5.9. Looping Over Map Contents
- 6.5.10. Check Your Understanding: Maps
- 6.5.11. The Set Interface
- 6.5.12. Syntax Practice: Making A Set
- 6.5.13. Adding Values to a Set
- 6.5.14. Syntax Practice: Adding to a Set
- 6.5.15. Checking Values in a Set
- 6.5.16. Syntax Practice: Set Contains
- 6.5.17. Removing Values from a Set
- 6.5.18. Syntax Practice: Set Remove
- 6.5.19. Looping Over Sets
- 6.5.20. Check Your Understanding: Sets
- 6.5.21. Programming Practice: Maps
- 6.6. Static, Main, and Exceptions
- 6.6.1. The Main Method
- 6.6.2. Check Your Understanding: Main Methods
- 6.6.3. The Static Keyword
- 6.6.4. Check Your Understanding: The Static Keyword
- 6.6.5. Errors
- 6.6.6. Throwing Exceptions
- 6.6.7. Check Your Understanding: Throwing Exceptions
- 6.6.8. Syntax Practice: Throwing Exceptions
- 6.6.9. Try/Catch Blocks
- 6.6.10. Check Your Understanding: Try/Catch Blocks
- 6.6.11. Syntax Practice: Try-Catch Blocks
Unit 7 Testing and Exceptions¶
- 7.1. Revisit Java Unit Testing
- 7.2. More on Exceptions
- 7.3. Objects, Enums, and UML Diagrams
- 7.4. More on Polymorphism
- 7.5. Unit 7 Lab 1 Placeholder
- 7.6. Style and Documentation
- 7.7. Bags
- 7.7.1. Objectives
- 7.7.2. Introduction to Bags
- 7.7.3. Documentation of Bag Interface methods
- 7.7.4. Using Bags
- 7.7.5. Checkpoint 1
- 7.7.6. Programming Practice: ArrayBags
- 7.7.7. Array Implementation of Bags
- 7.7.8. Checkpoint 2
- 7.7.9. Demo More bag method implementation
- 7.7.10. Checkpoint 3
- 7.7.11. Methods that Remove and Design Improvement Lesson and Demo
- 7.7.12. Checkpoint 4
- 7.7.13. Array resizing description and coding Demo
- 7.7.14. Programming Practice: The Bag Interface
- 7.8. Unit 7 Lab 2 Placeholder
- 7.9. Unit 7 Lab 3 Placeholder
Unit 8 Linked Lists, Bags, Stacks, and Efficiency¶
- 8.1. Linked Chains (Pointers)
- 8.2. Introduction to Linked Bags
- 8.2.1. Objectives
- 8.2.2. Linked Bags
- 8.2.3. Introduction to Linked Bags
- 8.2.4. LinkedBag add and toArray video
- 8.2.5. Checkpoint 1
- 8.2.6. Demo Video ExLinkedBagJunit
- 8.2.7. LinkedBag getFrequencyOf and contains video
- 8.2.8. Checkpoint 2
- 8.2.9. LinkedBag Removing an item
- 8.2.10. Checkpoint 3
- 8.2.11. Wrapping up Bags
- 8.2.12. Programming Practice: LinkedBags
- 8.3. Unit 8 Program 1 Placeholder
- 8.4. Efficiency
- 8.5. Stacks
- 8.5.1. Objectives
- 8.5.2. Introduction to Stacks
- 8.5.3. Checkpoint 1
- 8.5.4. StackIntroVideoMemory Example
- 8.5.5. Checkpoint 2
- 8.5.6. Stacks Array-Based Design
- 8.5.7. Checkpoint 3
- 8.5.8. Stacks Array Implementation
- 8.5.9. Stacks Linked Chain Implementation
- 8.5.10. Checkpoint 4
- 8.5.11. Programming Practice: LinkedStacks
- 8.6. Unit 8 Lab 1 Placeholder
- 8.7. Unit 8 Lab 2 Placeholder
Unit 9 Recursion and Software Design¶
- 9.1. Recursion
- 9.1.1. Objectives
- 9.1.2. Introduction to Recursion
- 9.1.3. Checkpoint 1
- 9.1.4. More Recursion
- 9.1.5. Programming Practice: Recursion 1
- 9.1.6. Recursion on Arrays
- 9.1.7. Checkpoint 2
- 9.1.8. Recursion on Arrays Middle
- 9.1.9. Checkpoint 3
- 9.1.10. Programming Practice: Recursion 2
- 9.1.11. Recursion on Linked Chain
- 9.1.12. Tower of Hanoi
- 9.1.13. Checkpoint 4
- 9.1.14. Recursion Wrap Up
- 9.1.15. Programming Practice: Recursion 3
- 9.1.16. Forward Flow Tracing Exercises
- 9.1.17. Backward Flow Tracing Exercises
- 9.1.18. Find Error Tracing Exercises
- 9.1.19. Two Recursive Calls Tracing Exercises
- 9.1.20. How Many Times Tracing Exercises
- 9.1.21. Harder Tracing Exercises
- 9.2. Software Design and MVC
- 9.2.1. Objectives
- 9.2.2. Introduction to Software design
- 9.2.3. Functional and non-functional requirements
- 9.2.4. Checkpoint 1
- 9.2.5. Identifying classes, fields, and methods
- 9.2.6. Design Activity: Case Study e-Commerce solution (online storefront) for ABC Ltd
- 9.2.7. Identifying relationships, hierarchies, and opportunities for reuse
- 9.2.8. Activity
- 9.2.9. Checkpoint 2
- 9.2.10. Intro to Design Patterns and MVC
- 9.2.11. [11:00] MVC and Observer Video
- 9.2.12. MVC Example AddressBook
- 9.2.13. Design Review: Case Study - e-Commerce solution (online storefront) for ABC Ltd.
- 9.2.14. Case Study - Vending Machine
- 9.3. Unit 9 Program 1 Placeholder
Unit 10 Queues and Generics¶
- 10.1. Generics 2
- 10.2. Queues
- 10.2.1. Objectives
- 10.2.2. Queues
- 10.2.3. Checkpoint 1
- 10.2.4. Programming Practice: Queues 1
- 10.2.5. Linked Queues Intro and Enqueue
- 10.2.6. Checkpoint 2
- 10.2.7. Linked Queues Removing and More (Dequeue and Other Methods)
- 10.2.8. Checkpoint 3
- 10.2.9. Deques
- 10.2.10. Checkpoint 4
- 10.2.11. Deque Removing and Wrap Up
- 10.2.12. Checkpoint 5
- 10.2.13. Array Implementation of Queues
- 10.2.14. Checkpoint 6
- 10.2.15. ArrayQueue One Unused Location
- 10.2.16. Checkpoint 7
- 10.2.17. ArrayQueue Ensure Capacity
- 10.2.18. Checkpoint 8
- 10.2.19. ArrayQueue WrapUp
- 10.2.20. Programming Practice: Queues 2
- 10.3. Unit 10 Lab 1 Placeholder
Unit 11 Lists and Iterators¶
- 11.1. Lists
- 11.1.1. Overview & Objectives
- 11.1.2. List Introduction
- 11.1.3. Checkpoint 1
- 11.1.4. LinkedList Add Implementation
- 11.1.5. Checkpoint 2
- 11.1.6. Tracing Add with Debugger
- 11.1.7. LinkedList Remove
- 11.1.8. Checkpoint 3
- 11.1.9. Programming Practice: Lists 1
- 11.1.10. Considering and Array Implementation of a List
- 11.1.11. Checkpoint 4
- 11.1.12. Considering an Array Implementation of a List
- 11.1.13. Programming Practice: Lists 2
- 11.2. Unit 11 Lab 1 Placeholder
- 11.3. Iterators
- 11.4. Unit 11 Lab 2 Placeholder
Unit 12 Comparing, Sorting and Binary Search¶
- 12.1. Comparing and Sorting
- 12.1.1. Objectives
- 12.1.2. Introduction to Ordering, Comparing, and Sorting
- 12.1.3. Checkpoint 1
- 12.1.4. Introduction to Sorting Video
- 12.1.5. Checkpoint 2
- 12.1.6. Selection Sort Video
- 12.1.7. Checkpoint 3
- 12.1.8. Insertion Sort
- 12.1.9. Checkpoint 4
- 12.1.10. Insertion Sort Array
- 12.1.11. Checkpoint 5
- 12.1.12. Programming Practice: Insertion Sort
- 12.1.13. Comparators
- 12.1.14. Programming Practice: Comparators
- 12.2. Binary Search
- 12.3. Unit 12 Program 1 Placeholder
Unit 13 Reference¶
- 13.1. Downloading and Setting up your lab in Eclipse
- 13.2. Importing and Using Downloaded Examples in Eclipse
- 13.3. Writing JUnit Tests with student.TestCase
- 13.3.1. Use JUnit
- 13.3.2. Run a JUnit Test
- 13.3.3. Naming Conventions
- 13.3.4. Instance Variables
- 13.3.5. setUp Method
- 13.3.6. tearDown Method (Optional)
- 13.3.7. Code coverage
- 13.3.8. Testing Exceptions
- 13.3.9. General Unit Testing Tips
- 13.3.10. Testing methods by passing null params
- 13.3.11. I/O Testing Tips
- 13.4. Java I/O tutorial
- 13.4.1. Files and Stream-based Input and Output
- 13.4.2. Basic Input and Output Concepts
- 13.4.3. Opening a Stream for Output
- 13.4.4. Writing to an Output Stream
- 13.4.5. Closing a Stream
- 13.4.6. A Complete Output Example
- 13.4.7. Output with System.out
- 13.4.8. Opening a Stream for Input
- 13.4.9. Reading from an Input Stream
- 13.4.10. A Complete Input Example
- 13.4.11. A Complete Input/Output Example
- 13.4.12. Testing I/O-based Operations
- 13.4.13. Dealing with Exceptions
- 13.5. Commenting guidelines
- 13.6. Tips on Random Numbers