A Java file-export component declares a method with a checked exception:
class Exporter { public void export() throws IOException { } }
Each table row proposes a method declaration in a separate direct subclass of Exporter. Every candidate has an empty body and an @Override annotation. All named exception classes are correctly imported.
Use these relationships: FileNotFoundException extends IOException; Exception is a superclass of IOException; SQLException is not a subclass of IOException; and IllegalStateException is unchecked.
Enter yes if the candidate compiles as an override, or no if its exception declaration prevents compilation.
Unlock full course notes by signing up
Tracing inherited implementations
A delivery scheduler estimates processing time in seconds with the Java classes below. Complete the table with the exact integer returned by each independent call.
Checking changes to an override
A monitoring application contains the following Java classes. Consider each proposed change independently, starting from this original code. Which statements are correct? Select all that apply.
Following an overridden helper through super
A game calculates an award using the Java classes below. The helper call bonus() is an ordinary instance-method call on the current object. What does the final statement print?
Calling an override before field initialization
A storage dashboard records available space when its monitor is constructed, then requests a fresh reading. Trace this Java program:
Java gives instance int fields the default value 0 before constructor code runs. A subclass's field initializer runs after its superclass constructor returns.
Report the stored available space printed by the first statement and the fresh available space printed by the second statement. Give both in MiB, as exact integers with zero decimal places.