(Updated January 20, 2025) Table of contents Overview Mean, Median and Mode Sorting Bubble Sort Selection Sort Insertion Sort Shell Sort Quick Sort Sort Stress Test Searching Linear (Sequential) Search Binary Search Exercises Overview Once we have data in arrays, we quickly realize the value of having it in one place and easily addressable and … Read More “Chapter 9S – Sorting and Searching” »
Category: Java Book
(Updated January 20, 2025) Table of contents Overview Arrays Dynamic Arrays, Initialization and length Array Processing Copying Arrays Arrays of Objects Variable Length Parameter List Two-Dimensional Arrays Review Summing Arrays Managing Arrays Quiz Afterward Exercises Overview In the past, when calculating an average, we could sum up values entered by the user (or read from … Read More “Chapter 9 – Arrays” »
(Updated January 20, 2025) Table of contents Overview Classes Constructors Variables and Instantiation Constructors and Methods of the Person Class Copy Constructor The toString Method Static Members of a Class The this Reference Method Chaining Inner Classes and File Scope Records Exercises Overview Up to this point, we have been solving problems using objects. Recall … Read More “Chapter 8 – User Defined Classes and Abstract Data Types” »
(Updated January 10, 2025) Table of contents JavaFX Overview Dialogs JavaFX Application The Stage The Scene Common UI Controls Layouts Events Graphics Exercises JavaFX Overview The JavaFX runtime environment is built upon the idea of a JavaFX application. Unlike Swing, a series of components your application can extend, JavaFX uses the Application class to create … Read More “Chapter 7 – Graphical User Interface – JavaFX” »
(Updated October 29, 2024) Table of contents Overview Windows and JFrame Adding Objects to JFrame Layouts (an introduction) Labels and Text Fields (JLabel, JTextField) Buttons (JButton) Event Handling Additional Layouts Graphics Exercises Overview The first time we used the GUI was back in the Objects, Input & Output section. Recall that the javax.swing package was … Read More “Chapter 7a – Graphical User Interface – Swing (OLD)” »
(Updated January 20, 2025) Table of contents Overview Getting Started User-Defined Methods Calling Our Methods void Methods Value-returning Methods Method Overloading Parameters Revisited Quiz Exercises Overview User-defined methods are methods created by the application writer to support a particular feature, to fulfill a specific need that has not already been met through the use of … Read More “Chapter 6 – User Defined Methods” »
(Updated January 19, 2025) Table of contents Overview The while loop Range-based or Counter-based loop Sentinel-based loop Flag-based loop EOF-based loop The for loop The do-while loop The break and continue statements Nested Loops File Handling Quiz Building a Command Line Interface Exercises Overview There is a clear need for repetition in many things during … Read More “Chapter 5 – Iterative Control Structures and Files” »
(Updated February 10, 2025) 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” »
(Updated January 7, 2025) 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 January 5, 2025) 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” »