Section 5d: Input exceptions 1. Is error handling permitted, required, or neither when you read…
Section 5d: Input exceptions
1. Is error handling permitted, required, or neither when you read from a file? What about when you read from standard input?
2. How does a try-catch block work? Where does control resume after a catch block is executed? How many catch blocks can be associated with one try block? If there are multiple catch blocks, how does the system know which one to execute? What happens to variables declared in a try block when a catch block is executed?
3. How does a throws clause work? Where do you put it?
Section 9a: Inheritance hierarchy
1. What is the difference between a direct superclass and an indirect superclass?
2. Does Java have single inheritance, multiple inheritance or both?
3. What is the difference between inheritance and composition? Which one can be described as an is a relationship? Which one can be described as a has a relationship?
Section 9b: Extending a class
1. What is the syntax for declaring class X to be a subclass of Y? If you don’t declare the superclass for a new class, which class is the implicit default?
2. What is the purpose of @override? Where do you put it? What happens if you override a class incorrectly while using @override? What happens if you override a class incorrectly without using @override?
3. Which features of the signature of the overriding method must match the signature of the overridden method?
4. How do you access a superclass method from a subclass when the subclass has an overriding version of the method?