Chapter 0 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. Weekly Schedule
- 0.1.5. Attendance and In-Class Participation
- 0.1.6. Reading Activities
- 0.1.7. Lab Assignments
- 0.1.8. Program Assignments
- 0.1.9. Quizzes
- 0.1.10. Programming Language and Environment
- 0.1.11. Cheating and The Virginia Tech Honor Code
- 0.1.12. AI and Long-Term Learning
- 0.1.13. AI Use Policy: Learning Support Only
Chapter 1 Objects, Classes, and Micro-Worlds¶
- 1.1. Objects, Classes, and Micro-Worlds
- 1.1.1. Installing BlueJ
- 1.1.2. Introducing LightBot
- 1.1.3. From LightBot to Micro Worlds
- 1.1.4. A Bit More LightBot
- 1.1.5. Textually Representing Programs
- 1.1.6. What Does LightBot Say About Programming?
- 1.1.7. A Programmable LightBot in Java
- 1.1.8. Creating New Objects
- 1.1.9. Calling Methods on an Object
- 1.1.10. Putting it All Together
- 1.1.11. We All Make Mistakes: Errors Happen
- 1.1.12. A Word on Making Code Easy to Read
- 1.1.13. Comparing Visual and Textual Programming
- 1.1.14. The Jeroos of Santong Island
- 1.1.15. Building Your Skills Through Practice
- 1.1.16. Programming Practice 1
Chapter 2 Methods, Selection, and Repeating Actions¶
- 2.1. Methods, Selection, and Repeating Actions
- 2.1.1. Creating Smarter Jeroos (Subclassing Basics)
- 2.1.2. Summarizing: What is Inheritance?
- 2.1.3. Creating and Using Jeroo Methods
- 2.1.4. Selection
- 2.1.5. Conditions Using Sensor Methods
- 2.1.6. An Overview of Conditional Statements
- 2.1.7. Java’s Syntax for the If-Then-Else Structure
- 2.1.8. Creating Optional Statements With If-then
- 2.1.9. Java’s Syntax for the If-then Structure
- 2.1.10. Java’s Syntax for the Multi-way Selection Structure (a cascaded if)
- 2.1.11. Your Opinions on Course Grading Policies
- 2.1.12. Repeating Actions
- 2.1.13. Generic Repetition Structures
- 2.1.14. Java’s Syntax for the While Loop
- 2.1.15. A First Taste of Testing: Verifying Jeroo Behavior
- 2.1.16. Building Your Skills Through Practice
- 2.1.17. Programming Practice 2
Chapter 3 Software Testing¶
Chapter 4 Variables, Primitive Types, Parameters, and Logic¶
- 4.1. Variables, Primitive Types, Parameters, and Logic
- 4.1.1. Java’s Primitive Types: Integers and Doubles
- 4.1.2. Characters, Booleans, and Literals
- 4.1.3. Arithmetic Operators & Integer Division Truncation
- 4.1.4. Parameters and Pass-by-Value Semantics
- 4.1.5. Writing Non-Void Methods with Return Statements
- 4.1.6. Boolean Operators: AND, OR, NOT & Short-Circuiting
- 4.1.7. Constructors in Subclasses & super(…)
- 4.1.8. Building Your Skills Through Practice
- 4.1.9. Programming Practice 4
Chapter 5 Fields, Encapsulation, and 2D Pixel Grids¶
- 5.1. Fields, Encapsulation, and 2D Pixel Grids
- 5.1.1. Instance Fields and State Persistence
- 5.1.2. Encapsulation & Access Modifiers (Private vs Public)
- 5.1.3. Accessor and Mutator Methods (Getters and Setters)
- 5.1.4. Variable Scope: Local, Parameter, and Field
- 5.1.5. Shadowing & The this Keyword
- 5.1.6. Applying Fields to Test Classes: The setUp Fixture
- 5.1.7. Introduction to Digital Images & RGB Color Model
- 5.1.8. Traversing Pixel Grids with Enhanced For-Each Loops
- 5.1.9. Building Your Skills Through Practice
- 5.1.10. Programming Practice 5
Chapter 6 Reactive Agent Simulations and Delegation¶
- 6.1. Reactive Agent Simulations and Delegation
- 6.1.1. Greenfoot Micro-Worlds & The Simulation Cycle
- 6.1.2. Finite State Logic & State Flags for Simulation Actors
- 6.1.3. Testing Autonomous Reactive Entities in JUnit
- 6.1.4. Object Association: Companion References in Fields
- 6.1.5. The Delegation Pattern: Forwarding Tasks to Partners
- 6.1.6. Synchronized Multi-Actor Coordination Algorithms
- 6.1.7. Stepwise Refinement & Method Length Control
- 6.1.8. Programming Practice 6
Chapter 7 Object-Oriented Inheritance, Overriding, and Interfaces¶
- 7.1. Object-Oriented Inheritance, Overriding, and Interfaces
- 7.1.1. Inheritance Hierarchies & The Object Base Class
- 7.1.2. IS-A vs. HAS-A: Inheritance vs. Composition
- 7.1.3. Method Overriding and the @Override Annotation
- 7.1.4. Polymorphism & Dynamic Method Dispatch
- 7.1.5. Polymorphic Reference Assignments
- 7.1.6. Defining and Implementing Java Interfaces
- 7.1.7. Designing Extensible Game Frameworks
- 7.1.8. Programming Practice 7
Chapter 8 Grouping Objects: Lists, Aggregation, and Strings¶
- 8.1. Grouping Objects: Lists, Aggregation, and Strings
- 8.1.1. Introduction to Grouping Objects: List
- 8.1.2. Core List Operations: Add, Remove, Size, Get
- 8.1.3. Generic Type Parameters & Type Safety
- 8.1.4. Encapsulating Collections: Decks and Hands
- 8.1.5. Iterating Lists with Enhanced For-Each Loops
- 8.1.6. Generating and Testing Random Behaviors
- 8.1.7. The null Keyword & Diagnosing NullPointerExceptions
- 8.1.8. String Manipulation & Immutability
- 8.1.9. Custom toString Formatting for Entities
- 8.1.10. Programming Practice 8
Chapter 9 Fixed-Size 1D Arrays and Array Idioms¶
- 9.1. Fixed-Size 1D Arrays and Array Idioms
- 9.1.1. Introduction to Fixed-Size 1D Arrays
- 9.1.2. Array Bounds, Indexing, and Default Values
- 9.1.3. Arrays Compared to Lists (ArrayList)
- 9.1.4. Initializing, Printing, and Naming Arrays
- 9.1.5. Array Reference Semantics, Aliasing, and Copying
- 9.1.6. Iterating Over Arrays: Numeric For vs. For-Each Loops
- 9.1.7. Array Index Arithmetic: Circular Wrap-Around & The Modulo Operator
- 9.1.8. Accumulator Idioms: Summing, Averaging, and Counting
- 9.1.9. Frequency Histograms & Array Buckets
- 9.1.10. Linear Search: Finding Values and Indices
- 9.1.11. Extrema Algorithms: Maximum, Minimum & Deterministic Tie-Breaking
- 9.1.12. Writing Test Assertions for Arrays in JUnit
- 9.1.13. Applying Arrays in a Problem
- 9.1.14. Programming Practice 9
Chapter 10 Multi-Dimensional Arrays and Matrix Algorithms¶
- 10.1. Multi-Dimensional Arrays and Matrix Algorithms
- 10.1.1. Introduction to 2D Arrays & Matrices
- 10.1.2. Row-Column Indexing & Array-of-Arrays Model
- 10.1.3. Traversing 2D Grids: Row-Major vs. Column-Major
- 10.1.4. Matrix Algorithms: Searching & Checking Rows
- 10.1.5. Row Shifting & Grid Transformations
- 10.1.6. Coordinate Mapping & Offset Arithmetic
- 10.1.7. Testing 2D Matrix Classes in JUnit
- 10.1.8. Programming Practice 10
Chapter 11 Abstract Classes, Frameworks, and Command Patterns¶
- 11.1. Abstract Classes, Frameworks, and Command Patterns
- 11.1.1. Abstract Classes and Incomplete Blueprints
- 11.1.2. Abstract Classes vs. Interfaces: Design Choices
- 11.1.3. The Command Pattern: Encapsulating Actions
- 11.1.4. Implementing Concrete Commands with Receivers
- 11.1.5. Text Input Processing with Scanner
- 11.1.6. Parsing Multi-Token Commands
- 11.1.7. Testing Text-Driven Command Interpreters
- 11.1.8. Programming Practice 11
Chapter 12 Maps, Sets, and Associative Data Modeling¶
- 12.1. Maps, Sets, and Associative Data Modeling
- 12.1.1. Introduction to Maps: Key-Value Associations
- 12.1.2. Core Map Operations: Storage, Retrieval, and Inspection
- 12.1.3. Sets and Uniqueness: Set & HashSet
- 12.1.4. Eliminating if-else Chains with Map Lookups
- 12.1.5. Modeling Spatial Worlds: Interconnected Locations and Pathway Maps
- 12.1.6. Case-Insensitive String Keys & Normalization
- 12.1.7. Testing Map-Driven Systems with TestCase
- 12.1.8. Programming Practice 12
Chapter 13 Variable Scoping, File Input/Output, and Streams¶
- 13.1. Variable Scoping, File Input/Output, and Streams
- 13.1.1. Comprehensive Scope: Blocks, Methods, Fields
- 13.1.2. Your Opinions on Course Grading Policies
- 13.1.3. Reading Text Files with Scanner and File
- 13.1.4. Writing Files with PrintWriter
- 13.1.5. Resource Management & Stream Closing
- 13.1.6. 2D Coordinate Geometry & Spatial Transformations
- 13.1.7. Euclidean Distance & Radial Modulation Formulas
- 13.1.8. Testing File I/O and Spatial Algorithms with TestCase
- 13.1.9. Programming Practice 13
Chapter 14 Static Members, Main Method, and Exception Handling¶
- 14.1. Static Members, Main Method, and Exception Handling
- 14.1.1. Static Fields: Class-Wide State
- 14.1.2. Static Methods & The Math Class
- 14.1.3. The Standard Application Entry: main
- 14.1.4. The Exception Hierarchy: Checked vs. Unchecked
- 14.1.5. Handling Exceptions with try-catch-finally
- 14.1.6. Throwing Exceptions for Invalid Arguments
- 14.1.7. Systematic Debugging & Defect Isolation with TestCase
- 14.1.8. Programming Practice 14
