September 2011
Beginner
650 pages
15h 47m
English
Try This 9-1 Adding Exceptions to the Queue Class
QExcDemo.java
In this project, you will create two exception classes that can be used by the queue classes developed by Project 8-1. They will indicate the queue-full and queue-empty error conditions. These exceptions can be thrown by the put( ) and get( ) methods, respectively. For the sake of simplicity, this project will add these exceptions to the FixedQueue class, but you can easily incorporate them into the other queue classes from Project 8-1.
1. Create a file called QExcDemo.java.
2. Into QExcDemo.java, define the following exceptions:

A QueueFullException is generated when an attempt ...
Read now
Unlock full access