Posts

Showing posts from August, 2024

Learn Java: The ABC's of Java

Image
Learn Java: The ABC's of Java Let's get right to it and explore a sample list of ABC's to support our learning of Java. A is for Arrays.  You can create simple one or two dimensional arrays in Java that allow you to keep a simple list of things.  A is also for algorithms, as algorithms (simple step by step processes of how you want your code to work in plain english) are the beginning of a great app.  A is also for abstraction because java code is a gateway into building real world capabilities that are "real enough" to learn and play and solve problems, and the art of coding only what you need to for a purpose is important. B is for Built in capabilities and functions.  This allows you to do so much with pure java, before you worry about any dependencies or even any imports, and these solve many, many problems for you.  Each data structure in java also has built in functions that help you do useful things like check its length.  B is also for bytecode, whi...

How to create a java app that creates a very simple plot from data in a csv file

Image
   How to create a java app that creates a very simple plot from data in a csv file To create a java app that creates a very simple plot from data in a csv file can be done in several ways.  In this example we'll use simple readily-available technology (specifically leveraging swing, which is an older java technology) instead of using more modern options like javafx and instead of pulling in some of the really cool packages out there now that can be leveraged from maven.  Depending upon comments and interests, we may show how to do the same (or better) using those technologies. Once you master this app, you could easily advance to more complex csv files and more complex aesthetics on the plot.  There are also a variety of plots you could explore. This is another baby step that is worthy of practicing, by following, and then by aiming to complete more and more without referencing, and then completely by memory, and to practice often. So let's do it, and discuss i...

How to create a java app that converts fahrenheit to celsius and allows you to list the cities you want converted in an input text file

Image
     How to create a java app that converts fahrenheit to celsius and allows you to list the cities you want converted in an input text file To create a java app that converts fahrenheit to celsius and allows you to read the input cities (and their default celsius) from an input text file, there are a number of small steps to take. Once you master this app, you could easily reverse the order and convert celsius to fahrenheight, or you could advance to more complex capabilities. This is another baby step that is worthy of practicing, by following, and then by aiming to complete more and more without referencing, and then completely by memory, and to practice often. So let's do it, and discuss it, just a bit ... Here's the code:    1 import java.io.BufferedReader;   2 import java.io.FileReader;   3 import java.io.FileWriter;   4 import java.io.IOException;   5 import java.io.PrintWriter;   6     7 public class FahrenheitToCelsius...