The remainingCapacity() method of DelayQueue always returns Integer.MAX_VALUE because a DelayQueue is not capacity constrained. That means, irrespective of the size of the DelayQueue it returns same result, i.e. Integer.MAX_VALUE.
public int remainingCapacity ()
Return Value: The function returns Integer.MAX_VALUE.
Exception: No exceptions are present.
Below programs illustrate the DelayQueue.remainingCapacity() method:
Size of the DelayQueue: 2 DelayQueue Remaining Capacity:2147483647 Size of the DelayQueue: 1 DelayQueue Remaining Capacity:2147483647 Size of the DelayQueue: 0 DelayQueue Remaining Capacity:2147483647
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.