The following is a little Java program that prints a Christmas tree to the terminal using ANSI escape sequences to add a little bit of colour. NOTE: colours will only appear on ANSI compatible terminal windows, so colours may not appear on Windows using the Command Prompt. https://github.com/stephensheridan/java-christmas-tree.git

This video is part 1 in a series of three videos that explores the if-statement in Java. It covers fundamentals, such as relational operators, boolean operators and booleans expressions, that form the foundation of creating conditional logic using if-statements. The video gives an overview of the relational operators greater than, greater than or equal to,Read more »

This video adds the ability to create menu items dynamically by reading items from an inventory text file. The inventory file uses a comma separated format to store menu items and their prices. A readInventoryFile method is developed to read the inventory file line by line and parse out the menu data in order toRead more »

In this video we build upon the code implemented in part 2 of the Text-based menu system series of videos by adding user input validation through the Keyboard java class. We also, replace the three arrays used to store menu data with a much more flexible ArrayList of MenuItem objects. Using an array of MenuItemRead more »

This video introduces the concept of Epoch Time and in particular Unix Epoch time. It details some of the history of Unix Time and considers the storage of epoch time using 32-bit and 64-bit signed integer values. It details some of the issues around using 32-bits for time storage including the famous year 2038 limitationRead more »

In this video, I introduce the concept of storing information in text file format. I create some data that represents a shopping list using an ArrayList and write the data to a file called shopping.txt using the Java FileWriter and PrintWriter classes. I then write a method to read the information back from the shopping.txtRead more »

In this video, I introduce the idea of collections of objects using a dynamic data structure in Java called the ArrayList. I show how to create a standard array of String objects and how to iterate over the array to print out the array items. I then replace this standard array with an ArrayList andRead more »

In this video, we build on the code developed in the basic user input validation video (linked below) by creating a Keyboard class that provides reusable user input validation routines. This makes it very easy to add user input validation to keyboard input in any program. Check out the previous video on Basic User InputRead more »

In this video, we build upon the handling runtime errors video content by using a try and catch block to handle basic user input validation. We show how input from the keybaord through the Java Scanner class can fail if the user enters an incorrect data type and we develop a solution that uses StringRead more »

This video introduces very basic runtime error handling in Java using try and catch blocks. The video covers two example programs that cause runtime errors (divide by zero and array index out of bounds) and uses try and catch blocks to handle the errors and allow the programs to continue and exit in a normalRead more »

Next Page »