954,545 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

is it possible that a LinkedStack will be full?

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...

l_03
Light Poster
37 posts since Oct 2008
Reputation Points: 5
Solved Threads: 0
 
Antenka
Posting Whiz
362 posts since Nov 2008
Reputation Points: 293
Solved Threads: 82
 
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 ?

verruckt24
Posting Shark
952 posts since Nov 2008
Reputation Points: 485
Solved Threads: 89
 
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.

~s.o.s~
Failure as a human
Administrator
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You