| ... | ... | @@ -165,7 +165,6 @@ public class UnexpectedCapacityException extends Exception {} |
|
|
|
```java
|
|
|
|
/**
|
|
|
|
* Creates a new stack of non negative integers, with given capacity, initially empty.
|
|
|
|
* If given capacity is not strictly positive, it is considered as the default value (DEFAULT_CAPACITY).
|
|
|
|
* @throws UnexpectedCapacityException if capacity is <=0
|
|
|
|
*/
|
|
|
|
public StackOfNonNegativeIntegers(int capacity) throws UnexpectedCapacityException {
|
| ... | ... | @@ -176,4 +175,4 @@ public StackOfNonNegativeIntegers(int capacity) throws UnexpectedCapacityExcepti |
|
|
|
this.size = 0;
|
|
|
|
this.elements = new int[this.capacity];
|
|
|
|
}
|
|
|
|
``` |
|
|
\ No newline at end of file |
|
|
|
``` |