Steps to create a java program

© 2012 by W. Patrick Hooper. Licensed under a Creative Commons Attribution 3.0 Unported License.

Purpose: This document outlines the basic steps that should be taken to create a Java program which does some mathematics and displays some graphics.


  1. Create some Java classes which represent mathematical objects.

    Java is an object oriented programming language, meaning that the programmer creates "objects," which can "do" various things using method calls. The things an object might do when a method is called include changing the objects internal state, creating a new object, modifying an object that is passed as a parameter to the method.

    Object oriented languages are well suited to represent mathematics, because we tend to thing of basic mathematical concepts as objects. Such a view goes back to Plato, who thought of mathematical objects as existing in a "world of ideal Forms."

    In any case, the most basic mathematical concepts can naturally be converted into objects in Java:

    A good strategy for programming in Java is to take existing source code and modify it to suit your needs. Some more Java classes which implement mathematical ideas are available here:

    You can download all these files from this page.

    As you create your mathematical objects, you should continually test what you are doing by writing simple executable programs that print the results of operations you have created.

  2. Displaying Mathematical Graphics

    When creating a program to display mathematical graphics, you should follow the same ideas as above. You should modify existing source code to do what you want.

    I've created three "templates" for graphical programs below.

    You can download all these files from this page.

Useful Links


Valid XHTML 1.0 Strict Valid CSS!

This presentation is part of a Mathematical Research Oriented Java Tutorial, which aims to introduce students to the benefits that writing computer programs can provide to their understanding of mathematics.