Calculator Application

Published March 30th 2010
Filed under Java

The latest project I worked on in college is a calculator created using TDD (Test Driven Development). It’s based on a project taken from Google’s Testing Blog located here. It’s a fully functioning calculator similar to the one available with Windows.

I’ve added it to a .jar file which you can download below and run by double-clicking it like a normal application after extracting it from the .zip archive. Extracting the .jar file afterwards will show you my source code.


Java Projects

Published January 25th 2010
Filed under Java

I haven’t added any Java projects in a while. This first one is a text alerts project where a match attender notifies subscribers about any updates from a certain match.

This second one is a basic application with a user interface using a MiGLayout and Swing. It will run by double-clicking the extracted file.

Both projects will only work if you have Java installed and the first one will only work if you run it in either Eclipse or Command Prompt.

Java Constants

Published December 10th 2009
Filed under Java

A constant in java is a variable with a pre-defined value. To declare a variable as a constant, use the final modifier:

public static final int VARIABLENAME = 0;

VARIABLENAME can’t ever be assigned to a different value.

The full name for this declaration is an enumerated constant.

Different Java Classes

Published December 10th 2009
Filed under Java

In java, a class is a (possibly partial) implementation of a type. There are 3 different classes; concrete classes, abstract classes and interface classes. Concrete is a fully complete class, abstract is a semi-completed class and an interface is an incomplete class. An interface is fully abstract with no method implementation. The reason for an abstract class is because the implementation is too general at a high level.

Type: List of responsibilities (method headers)

Class: Type and implementation (instance variables and method bodies)

In java there is single implementation inheritance, but multiple interface inheritance i.e. you can only have one class listed after extends, but you can have a comma-separated list after interface.

Java Concepts

Published November 23rd 2009
Filed under Java

These are some definitions from college. They’re probably some of the harder ones so by posting them here even I might understand them better by reading them.

Cast: A cast changes the type of an expression without changing the value of the expression.

Expression: Something that has a value – to obtain the value, you evaluate the expression.

Dynamic Binding: The method that is bound to a call is selected at runtime on the basis of the dynamic type of the variable.

Calling Methods: If there is no explicit receiver, the receiver is implicitly “this”.