What is the access of all the methods in a Java interface? -Correct
Answer ✔ ✔ public
Can an interface be instantiated? -Correct Answer ✔ ✔ No
Give two reasons for interfaces in the Java language. -Correct Answer
✔ ✔ To implement a list of methods and organization
How many interfaces can another class implement -Correct Answer
✔ ✔ As many as needed
What does it mean to implement a Java interface -Correct Answer ✔
✔ Create a class that overrides all the methods
If a class extends an Employee class and implements a Comparable
interface, what are the is-a relationships established? -Correct Answer
✔ ✔ The given class is a: is - a relationship
,How many classes can a given class extend? -Correct Answer ✔ ✔
one
Name five Java pre-written interfaces -Correct Answer ✔ ✔ N/A
What are the two broad categories of Exceptions in Java? -Correct
Answer ✔ ✔ Checked and Unchecked(Run Time)
What is the major difference between a checked exception and an
unchecked exception? -Correct Answer ✔ ✔ Checked: is all those
Exception which requires being catches and handled during compile
time.
Unchecked: is those Exceptions whose handling is not verified during
Compile time.
What are the programmer's two choices when writing code that may
cause a checked-exception to be thrown by the Java virtual machine?
-Correct Answer ✔ ✔ "throws IOException" or a "Try-Catch block"
, What clause( block) in the exception-handling mechanism in Java is
optional? -Correct Answer ✔ ✔ Finally Block is optional
Is it possible to have many catch blocks for one try block? -Correct
Answer ✔ ✔ Yes
What is meant by the error going up through the call stack? -Correct
Answer ✔ ✔ propagation
What is meant by "handling" an error? -Correct Answer ✔ ✔ In
Java errors are handled by an Exception object.
What is the ancestor of all Java exceptions that can be thrown? -
Correct Answer ✔ ✔ Throwable
Can a programmer create his/her own Exception class? -Correct
Answer ✔ ✔ Yes. A programmer can create their own Exception
class in Java.