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.

Portfolio Update

Published December 01st 2009
Filed under Portfolio

I’ve added some new designs to the Portfolio section. These include a new Rachel Stevens layout and a new section for some blog layouts I’ve made recently.

Click on the thumbnails below to view either sections:

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”.

Some Java Projects

Published November 22nd 2009
Filed under Java

I haven’t updated this in ages. I got really bored of website stuff for a while. Anyway I thought I’d upload some of my Java projects from college. Only download them if you have Eclipse or know how to run Java projects in command prompt.

This first one is the last project I did in first year. It was made in Blue J so it had no Main method so I added one in. It’s a really boring game called Zuul where you have to move around rooms and pick up items to win the game:

Zuul.rar

This next one is my first Algorithms assignment from this year. It’s just a college of students stored in a linked list instead of a pre-written data structure:

MyCollege.rar