
The figures above show the HighBalanceException and CustomerAccount classes. Explain what is involved in creating your own throwable Exceptions. Explain what will happen if the CustomerAccount throws a HighBalanceException.
What will be an ideal response?
To create your own throwable Exception class, you must extend a subclass of Throwable. Throwable has two subclasses, Exception and Error, which are used to distinguish between recoverable and nonrecoverable errors. Because you always want to create your own exceptions for recoverable errors, your classes should extend the Exception class.
The CustomerAccount class uses a HighBalanceException. The CustomerAccount constructor header indicates that it might throw a HighBalanceException (see the first shaded statement); if the balance used as an argument to the constructor exceeds a set limit, a new, unnamed instance of the HighBalanceException class is thrown (see the second shaded statement).
You might also like to view...
Codecs are often bundled together into a single media player program to reduce confusion to the user
Indicate whether the statement is true or false
_________ are enterprises that own or operate the paths or "roadways" along which Internet data travels. A. Hardware and software companies B. Infrastructure companies C. Quoted companies D. Shipping companies
Fill in the blank(s) with the appropriate word(s).
Which of the following statements pertain to disk defragmentation?
A) It must be run manually. B) It reorganizes fragmented files into unused space. C) It rearranges used space into one large block. D) It deletes fragmented files into contiguous blocks.
Answer the following statements true (T) or false (F)
1. Data structures are those data items within the system that are not meaningful if broken down further. 2. A default value is one that never changes on a report. 3. A discrete data element is one that has certain fixed values. 4. When a V is used as a formatting character for an element, it indicates where the decimal point should occur, even though the actual decimal point is not included. 5. All derived elements must be stored on a data store.