I think you'll find joe, that that is kind of a "better" way of doing it. you know, like the way you're taught to print letters when you want to write neat. This code works just fine for example.
public class AeroplaneLeg
{
public static final int MINUTES_PER_HOUR = 60;
private String flightNo;
private Time startTime;
private Time finishTime;
/**
* Constructors for objects of class Aeroplane
*/
public AeroplaneLeg()
{
flightNo = null;
startTime = null;
finishTime = null;
}
public AeroplaneLeg (String fn, Time st, Time ft)
{
flightNo = fn;
startTime = st;
finishTime = ft;
}
/**
* Set instance variable startTime
*
* @param sst a Time parameter
*/
public void setStartTime (Time sst)
{
startTime = sst;
}
etc, etc, etc...
And if you're at all interested in what a collection is, the best place to start is usually the SDK.
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collections.html
And as far as I know, a function is usually reserved for talking about something that takes care of a calculation that you will use again and again. For example
A function that calculates the simple linear regression for a set of data.
You set it up so you just have to plug in the input and get the output (usually some kind of number for a function).
A method is anything that you can call from a class. So you could say that a function is a type of method.
BUT that's all just pedantics. I don't think it really matters that much, since it's just terminology.