[Bluej-discuss] ArrayList

Luis Moreira Luis.Moreira at jet.uk
Tue Aug 22 08:49:01 BST 2006


Thank you all for the help.

Now that you tolled me about it, I can see it clearly.

This is what happens when you take a few weeks break from JAVA :-)

Best regards

                        Luis

 

 

 

-----Original Message-----
From: bluej-discuss-bounces at bluej.org
[mailto:bluej-discuss-bounces at bluej.org] On Behalf Of Brian Brookwell
Sent: 21 August 2006 16:28
To: General discussion for users of BlueJ
Subject: Re: [Bluej-discuss] ArrayList

 

It's a common problem.  When you create the seats object using 

 

	    public Row(int rowNumber, int numberOfSeats)

	    {

	        this.numberOfSeats = numberOfSeats;

	        this.rowNumber = rowNumber;

	        ArrayList seats = new ArrayList();

	        creatSeats();

	    }

	 

 

You are creating a local variable called seats not using the instance
variable.  Replace the line:

 

            ArrayList seats = new ArrayList();

 

By

 

            seats = new ArrayList();

 

That way you'll be using the instance variable

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bluej.org/pipermail/bluej-discuss/attachments/20060822/6707da84/attachment-0001.html


More information about the bluej-discuss mailing list