Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Array Stack help

807605Mar 16 2007 — edited Aug 30 2007
learning stacks in my java class.
have an assignment with some questions.

please someone correct me if im wrong, but when you push a number into a stack it goes into an array bassicaly..now does that start at index 0? i mean the first open slot?

cause if im thinking right the question im givin is that:

Convention 1: We store items at the low end, starting at index 0(to my knowledge that would be the begging of the array) We use the variable count which equals the number of items on the stack.

sample questions being asked::

-Write the code for isEmpty() - I put public boolean isEmpty()

am i on the right course or is it asking the actual code used to find if it is empty in the code?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 27 2007
Added on Mar 16 2007
10 comments
212 views