Campbell Ritchie wrote:Welcome to the Ranch
. . . .
Paul Clapham wrote:You seem to be concerned by the fact that startPrice is zero. And your debugging code seems to confirm that fact.
But on the other hand I don't see any code which sets that variable to anything. For that matter I don't even see any code which declares that variable. So the fact that it is zero is totally unsurprising to me. What reason do you have for expecting it to have some other value?
shea terry wrote:So im trying to pull it from a linked list where it is defined as a constructor in the Account class
That's a pleasureshea terry wrote:. . . Much appreciated.
Famous last words. Make sure your code is as well formatted and in the best possible style as soon as you write it. It will be much quicker in the long run . . . and you won't forget to come back to it. Remember that Eclipse will do most of that automatically.The poor formatting is down to a frantic group effort and was going to attempt to tidy . . . .
I don't like that error message, saying, “non‑static,” which misleads lots of beginners into making something static which oughtn't to be. Wherever your are calling that method from should most probably have static deleted.. . . i cannot use Auction.getAuctionID as it is called from a non static environment . . . .
Only make something static iif you know why it should be static. If your original code works with something static, that may simply mean you haven't tested it with enough different auctions. By the way, selling one item isn't an auction; that is a lot.shea terry wrote:. . . my original code that works when the variables are set as a static . . .
I have spent lots of effort showing you how to format your code correctly.(Needs formatting i think) . . .
Paul Clapham wrote:... or maybe Auctions is a variable referring to a list of Auction objects? Standard practice in Java is for class names to start with capital letters and for variable and method names to start with lower-case letters. So Auctions should be a class. However I see you have methods whose names start with capital letters, so we're left guessing about Auctions.
shea terry wrote:So there is a linked list called Auctions
the public method Auction holds constructors for the data types being held in the linked list, one of which is the AuctionID.
My honeysuckle is blooming this year! Now to fertilize this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|