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
Offline 8,872 posts
since Jun 2006