阅读背景:

Java:在处理方法之前抛出EmptyQueueException

来源:互联网 

I'm working on a stock exchange program as a project and so far I've gotten about 98% of it done, the only issue I am having is when I am trying to sell more shares than a current day holds. So for example, I buy 20 shares for each on day 1 and 40 shares for each on day 2. I then input saying I want to sell 30 shares for each. What the code is supposed to do is sell all the shares from day one, and then sell 10 shares from day 2. However, what I'm getting is an EmptyQueueException being thrown. I feel that my sellShares method might be having the error when it goes into the final else statement with the while loop. However I cannot wrap my mind around what might be the error. I've been staring the code down for quite some time and I can't seem to figure out a solution to this. Some assistance on this would greatly be appreciated. The following code is from my main class and the CircleArrayQueue class:I'm working on a stock exchange program as a pr




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: