Example: ArrayQueue
class ArrayQueue {
final int maxSize=10;
int size=0;
Object q = new Object[maxSize];
void insert(Object newobj) {
if (size >= maxSize) {
throw new QueueSizeException();
} else {
q[size++] = newobj;
}
}
…
}
Previous slide
Next slide
Back to first slide
View graphic version