943,960 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 458
  • Java RSS
Jan 9th, 2009
0

is it possible that a LinkedStack will be full?

Expand Post »
hello...i am confused,,it is possible that a linkedstack will be full??i only implement a method that isEmpty(),,and it reads the method if the stack is empty..but if the stack is full, it do not even read the method i made....would someone help me?/,,,thank you ahead...
Similar Threads
Reputation Points: 5
Solved Threads: 0
Light Poster
l_03 is offline Offline
37 posts
since Oct 2008
Jan 10th, 2009
0

Re: is it possible that a LinkedStack will be full?

I hope, this may help you:
Object-Oriented Data Structures Using Java
Reputation Points: 293
Solved Threads: 82
Posting Whiz
Antenka is offline Offline
361 posts
since Nov 2008
Jan 10th, 2009
0

Re: is it possible that a LinkedStack will be full?

Click to Expand / Collapse  Quote originally posted by l_03 ...
hello...i am confused,,it is possible that a linkedstack will be full??i only implement a method that isEmpty(),,and it reads the method if the stack is empty..but if the stack is full, it do not even read the method i made....would someone help me?/,,,thank you ahead...
If you know what a "linked" list is, and I suppose you ought to know that if you are implementing a stack with it, what does common sense tell you ?
Reputation Points: 485
Solved Threads: 89
Posting Shark
verruckt24 is offline Offline
944 posts
since Nov 2008
Jan 11th, 2009
0

Re: is it possible that a LinkedStack will be full?

Click to Expand / Collapse  Quote originally posted by l_03 ...
hello...i am confused,,it is possible that a linkedstack will be full??i only implement a method that isEmpty(),,and it reads the method if the stack is empty..but if the stack is full, it do not even read the method i made....would someone help me?/,,,thank you ahead...
The Collection classes of Java increase in capacity on demand. If the number of elements added to an ArrayList exceed its default capacity, it grows on demand automatically to make space or room for the newly added elements.

The only practical limit to the number of items that can be added to a List is the amount of physical memory allocated to the process [java process] and hence there seems to be no reason or need to implement a isFull() method for a collection class. If you need such a behavior, either subclass the AbstractSequentialList class to add an upperbound to the number of elements that can be added or just use arrays if the exact number of elements are known.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 720
Failure as a human
~s.o.s~ is offline Offline
8,872 posts
since Jun 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Noob Help
Next Thread in Java Forum Timeline: help required in painComponent()





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC