Course Policies¶
- 0.1. Understanding this Course
- 0.1.1. Read the Course Syllabus
- 0.1.2. Who Is This Class For?
- 0.1.3. Students of Many Experience Levels
- 0.1.4. Online and Face-to-face Sections
- 0.1.5. Weekly Schedule
- 0.1.6. Reading Activities
- 0.1.7. Labs
- 0.1.8. Programming Assignments
- 0.1.9. Programming Language and Environment
- 0.1.10. Cheating and The Honor Code
- 0.1.11. Self-Check: Confirm Your Understanding
Getting Started¶
- 1.1. Getting Started
- 1.1.1. Installing BlueJ
- 1.1.2. Introducing LightBot
- 1.1.3. From LightBot to Micro Worlds
- 1.1.4. Self Check: Micro-Worlds
- 1.1.5. A Bit More LightBot
- 1.1.6. Textually Representing Programs
- 1.1.7. Self-Check: Turning Micro-Worlds into Code
- 1.1.8. What Does LightBot Say About Programming?
- 1.1.9. A Programmable LightBot in Java
- 1.1.10. Syntax Practice 1a
- 1.1.11. Creating New Objects
- 1.1.12. Calling Methods on an Object
- 1.1.13. Putting it All Together
- 1.1.14. A Word on Making Code Easy to Read
- 1.1.15. Syntax Practice 1b
- 1.1.16. Programming Practice 1
- 1.1.17. Check Your Understanding
Inheritance and Polymorphism¶
- 2.1. Inheritance and Polymorphism: Subclasses and Methods
- 2.1.1. The Jeroos of Santong Island
- 2.1.2. Your Opinions on Course Grading Policies
- 2.1.3. Class Hierarchy and Inheritance
- 2.1.4. Summarizing: What is Inheritance?
- 2.1.5. Syntax Practice 2a: Jeroo Methods
- 2.1.6. Problem Solving and Algorithms
- 2.1.7. Creating and Using Jeroo Methods
- 2.1.8. What is Polymorphism?
- 2.1.9. Syntax Practice 2b: Subclass Constructors
- 2.1.10. Syntax Practice 2c: More Subclass Constructors
- 2.1.11. Programming Practice 2
- 2.1.12. Check Your Understanding
Conditional and Repeating Actions¶
- 3.1. Conditional and Repeating Actions
- 3.1.1. Selection
- 3.1.2. Conditions Using Sensor Methods
- 3.1.3. An Overview of Conditional Statements
- 3.1.4. Java’s Syntax for the If-Then-Else Structure
- 3.1.5. Syntax Practice 3a: If-Then-Else
- 3.1.6. Creating Optional Statements With If-then
- 3.1.7. Java’s Syntax for the If-then Structure
- 3.1.8. Syntax Practice 3b: If-Then
- 3.1.9. Java’s Syntax for the Multi-way Selection Structure (a cascaded if)
- 3.1.10. Syntax Practice 3c: Multi-way If
- 3.1.11. Compound Conditions
- 3.1.12. Syntax Practice 3d: Compound Conditions
- 3.1.13. Your Opinions on Learning and Engagement
- 3.1.14. Repeating Actions
- 3.1.15. Generic Repetition Structures
- 3.1.16. Java’s Syntax for the While Loop
- 3.1.17. Syntax Practice 3e: While Loops
- 3.1.18. Programming Practice 3
- 3.1.19. Check Your Understanding
Software Testing¶
- 4.1. Software Testing
- 4.1.1. What Is Software Testing?
- 4.1.2. Writing Your First Software Test
- 4.1.3. Check Your Understanding: Software Testing Concepts
- 4.1.4. More About Methods
- 4.1.5. Check Your Understanding: Method Signatures
- 4.1.6. Check Your Understanding: Methods with Parameters
- 4.1.7. Good Habits for Conditionals
- 4.1.8. A Different Type of Complex If-Statement
- 4.1.9. Short Circuit Evaluation
- 4.1.10. Check Your Understanding: Logical Equivalence
- 4.1.11. Syntax Practice 4a: Compound Conditionals
- 4.1.12. Syntax Practice 4b: Conditionals and Relational Operators
- 4.1.13. Programming Practice 4
- 4.1.14. Module Review
Variables, Fields, and Parameters¶
- 5.1. Variables, Fields, and Parameters
- 5.1.1. Variables
- 5.1.2. Check Your Understanding: Variables
- 5.1.3. Fields Versus Local Variables
- 5.1.4. Changing Private Variables: Mutator Methods
- 5.1.5. Check your Understanding: Scope
- 5.1.6. Accessor Methods
- 5.1.7. Check Your Understanding: Fields, Getters and Setters
- 5.1.8. Syntax Practice 5a: Fields and Accessors
- 5.1.9. The Return Keyword
- 5.1.10. Check your Understanding: Typed Methods and Return Statements
- 5.1.11. Syntax Practice 5b: Mutators and Return Statements
- 5.1.12. Using Fields in Testing
- 5.1.13. Programming Practice 5a
- 5.1.14. Programming Practice 5b
Pictures and For-each Loops¶
- 6.1. Pictures and For-each Loops
Aggregation, Strings and More Loops¶
- 7.1. Aggregation, Strings and More Loops
- 7.1.1. Object-Oriented Design: Aggregation, Composition, and Delegation
- 7.1.2. Strings and Characters
- 7.1.3. Check Your Understanding: Strings
- 7.1.4. Counter-controlled Loops
- 7.1.5. Check Your Understanding: Counter Controlled Loops
- 7.1.6. Tips on Random Numbers
- 7.1.7. Check Your Understanding: Random Numbers
- 7.1.8. Method Overriding
- 7.1.9. Check Your Understanding: Method Overriding
- 7.1.10. Syntax Practice 7a: For Loops and OO Design
- 7.1.11. Syntax Practice 7b: toString and Returning Values
- 7.1.12. Programming Practice 7a
- 7.1.13. Programming Practice 7b
Grouping Objects Using Lists and Nested For Loops¶
- 8.1. Grouping Objects Using Lists and Nested For Loops
- 8.1.1. Collections of Objects
- 8.1.2. Interfaces
- 8.1.3. Check Your Understanding: Interfaces
- 8.1.4. Syntax Practice 8a: Strings
- 8.1.5. The List Interface
- 8.1.6. Generics
- 8.1.7. ArrayList
- 8.1.8. Check Your Understanding: ArrayLists
- 8.1.9. Syntax Practice 8b: Lists
- 8.1.10. Nested For Loops
- 8.1.11. Check Your Understanding: Nested For Loops
- 8.1.12. Syntax Practice 8c: Nested Loops
- 8.1.13. Check Your Understanding
- 8.1.14. Programming Practice 8a
- 8.1.15. Programming Practice 8b
Lists, Loop Idioms, Generics, and the Null Keyword¶
- 9.1. Lists, Loop Idioms, Generics, and the Null Keyword
- 9.1.1. Modelling the Contents of a Library
- 9.1.2. Looping Idioms
- 9.1.3. Check Your Understanding: Loop Idioms
- 9.1.4. Syntax Practice 9a: Loop Idioms
- 9.1.5. Generics Revisited
- 9.1.6. Check Your Understanding: Generics
- 9.1.7. Syntax Practice 9b: Generics
- 9.1.8. The Null Keyword
- 9.1.9. Diagnosing a Null Pointer Exception
- 9.1.10. Check Your Understanding: Null
- 9.1.11. Using BlueJ’s Debugger
- 9.1.12. Using BlueJ’s Code Pad
- 9.1.13. Programming Practice 9a: Loop Idioms
- 9.1.14. Programming Practice 9b: Loops and Generics
Arrays¶
- 10.1. Arrays
- 10.1.1. Creating An Array
- 10.1.2. Accessing Items in Arrays
- 10.1.3. Setting Items in an Array
- 10.1.4. Arrays Compared to Lists (or ArrayList)
- 10.1.5. Putting It All Together
- 10.1.6. Check Your Understanding: Arrays
- 10.1.7. Syntax Practice 10a
- 10.1.8. Iterating Over Arrays
- 10.1.9. Check Your Understanding: Iterating with Arrays
- 10.1.10. Syntax Practice 10b
- 10.1.11. Initializing Array Contents
- 10.1.12. Printing Arrays
- 10.1.13. Copying Array Variables
- 10.1.14. Naming Array Variables
- 10.1.15. Writing Test Assertions Involving Arrays
- 10.1.16. Applying Arrays in a Problem
- 10.1.17. Syntax Practice 10c
- 10.1.18. Check Your Understanding
- 10.1.19. Programming Practice 10a
- 10.1.20. Programming Practice 10b
Multi-dimensional Arrays¶
- 11.1. Multi-dimensional Arrays
- 11.1.1. Dimensions in an Array
- 11.1.2. Check Your Understanding: 2D Arrays
- 11.1.3. Syntax Practice: 2D Array Basics
- 11.1.4. Iterating through a 2D Array
- 11.1.5. Check Your Understanding: Iterating with 2D Arrays
- 11.1.6. Syntax Practice: Looping Over 2D Arrays
- 11.1.7. Multi-Dimensional Arrays
- 11.1.8. Syntax Practice: 3D Arrays
- 11.1.9. But Can You Have Multi-dimensional Lists?
- 11.1.10. Integer Division and Modulus
- 11.1.11. Check Your Understanding: Modulus
- 11.1.12. Syntax Practice: Modulus
- 11.1.13. Programming Practice: Multi-dimensional Arrays
- 11.1.14. Programming Practice: Mod
Variable Scoping, Input, and Output¶
- 12.1. Variable Scoping, Input, and Output
- 12.1.1. Variable Scoping
- 12.1.2. Summarizing Scope Concepts
- 12.1.3. Check Your Understanding: Scope
- 12.1.4. Syntax Practice: Scoping
- 12.1.5. Java Input and Output
- 12.1.6. Output Using PrintWriters
- 12.1.7. Check Your Understanding: Output
- 12.1.8. Input Using Scanners
- 12.1.9. A Complete Input Example
- 12.1.10. Check Your Understanding: Input
- 12.1.11. A Complete Input/Output Example
- 12.1.12. Testing I/O-based Operations
- 12.1.13. Check Your Understanding: Testing
Maps and Sets¶
- 13.1. Maps and Sets
- 13.1.1. The Map and Set Interfaces
- 13.1.2. The Map Interface
- 13.1.3. Syntax Practice: Making Maps
- 13.1.4. Adding and Accessing Pairs in a Map
- 13.1.5. Syntax Practice: Adding to Maps
- 13.1.6. Checking for and Removing Pairs in a Map
- 13.1.7. A Visual Summary of Using Map and HashMap
- 13.1.8. Syntax Practice: Map Contains and Remove
- 13.1.9. Looping Over Map Contents
- 13.1.10. Check Your Understanding: Maps
- 13.1.11. Your Opinions on Course Grading Policies
- 13.1.12. The Set Interface
- 13.1.13. Syntax Practice: Making A Set
- 13.1.14. Adding Values to a Set
- 13.1.15. Syntax Practice: Adding to a Set
- 13.1.16. Checking Values in a Set
- 13.1.17. Syntax Practice: Set Contains
- 13.1.18. Removing Values from a Set
- 13.1.19. Syntax Practice: Set Remove
- 13.1.20. Looping Over Sets
- 13.1.21. Check Your Understanding: Sets
- 13.1.22. Programming Practice: Maps
Static, Main, and Exceptions¶
- 14.1. Static, Main, and Exceptions
- 14.1.1. The Main Method
- 14.1.2. Check Your Understanding: Main Methods
- 14.1.3. The Static Keyword
- 14.1.4. Check Your Understanding: The Static Keyword
- 14.1.5. Your Opinions on Learning and Engagement
- 14.1.6. Errors
- 14.1.7. Throwing Exceptions
- 14.1.8. Check Your Understanding: Throwing Exceptions
- 14.1.9. Syntax Practice: Throwing Exceptions
- 14.1.10. Try/Catch Blocks
- 14.1.11. Check Your Understanding: Try/Catch Blocks
- 14.1.12. Syntax Practice: Try-Catch Blocks