(Updated September 1, 2024) Table of contents Relational Operators One-way and two-way selection Compound Statements Multi-way selection The Dangling else Logical Operators Comparing Strings The switch Statement Short-circuit Evaluation The ternary operator ?: Quiz Exercises Relational Operators Up to this point, our statements have been executing sequentially; they have been processed in order without any … Read More “Chapter 4 – Conditional Control Structures” »
Category: Java Book
(Updated September 1, 2024) Getting Started Ok. Now we have some basic abilities at our disposal. We can now begin roughing out the game – at least from the viewpoint of the initial setup. First, we will begin with a basic template for nearly all basic Java programs: CodeBreakerI2.java (template) import java.util.Scanner; public class CodeBreakerI2 … Read More “JPbD CodeBreaker Interlude 2” »
(Updated November 21, 2024) Table of contents Objects Packages of Predefined Classes and Methods Random Numbers – Math.Random() (OPTIONAL) Random Numbers – Random Class (OPTIONAL) Random Numbers – ThreadLocalRandom Class String – Revisited VIDEO – Strings Output with the printf() method Wrapper Classes GUI-based I/O VIDEO – Basic GUI with JOptionPane Converting println to printf … Read More “Chapter 3 – Objects, Input and Output” »
(Updated November 18, 2024) Table of contents Overview Components of the Language Data Types Arithmetic Operators and Precedence String Class Named Constants and Variables VIDEO – Basic Java Program Basic Input/Output Escape Increment, Decrement, Concatenation and Comments The Dot Operator VIDEO – Java Program Demonstrating Basic I/O Quiz Exercises Overview This is an extensive chapter. … Read More “Chapter 2 – Elements of the Java Language” »
(Updated November 21, 2024) Table of Contents About the Second Edition A Brief History of Java Translating the Language An Example A Word on Programming Methodologies A Proposed Template Quiz Exercises About the Second Edition This textbook has undergone a significant renovation in 2024. There is now a button for nearly every complete program that … Read More “Chapter 1 – The Java Environment” »
(Updated August 26, 2024) At one point, you may have played Mastermind®. Your opponent picks 4 pegs of various colors (red, orange, yellow, white, blue, green) and places them behind a secret. You then have a predetermined number of guesses to figure it out. You may have 8 or 10 or some other number of … Read More “JPbD CodeBreaker Interlude 1” »
This textbook follows a few basic teaching paradigms, which are as follows: Constructivism – the premise that learning occurs through the physical building (construction) of solutions. Therefore, this is a project-based approach. Throughout this textbook, there are two primary subplots. During what would be considered the first semester of study (Chapters 1 to 9), learners … Read More “Introduction” »
October 2023 When I first began teaching, I knew nothing about how people learn, save one person – myself. The way I learned was nearly never the same as how others learned. So, after a couple of decades of honing my craft, I decided it was high time I invested in myself. My masters work … Read More “Acknowledgements” »