[Bluej-discuss] exercise 4.24 Objects with Java Blue-J

Marko Bajic mbnov26 at hotmail.com
Sat Apr 8 09:23:13 BST 2006


I am having trouble with exercies 4.24 of objects Java Blue-j. I have done 
everything but the program does not want to show the name of the bidder. I 
compile the program and it shows no syntax error but when I get to 
initializing the close method the NoSuchElementException error message 
appears. Here is my program:

public void close()
  {
      Iterator it = lots.iterator();
      while(it.hasNext()) {
          Lot lot = (Lot) it.next();
          Bid bid = (Bid) it.next();
          if(lot.getHighestBid() == null){
        System.out.println(lot.toString() + "unsold");
      }else{System.out.println(lot.toString()+ " sold" + bid.getBidder());
      }
  }

It prints out the name of the lot and the price it was sold for and if it 
was sold or not but it does not show the name of the bidder. Please help me 
so I can continue my work with the book.

Thankyou
Regards,
Marko Bajic

_________________________________________________________________
New year, new job – there's more than 100,00 jobs at SEEK 
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eseek%2Ecom%2Eau&_t=752315885&_r=Jan05_tagline&_m=EXT



More information about the bluej-discuss mailing list