Question: QUESTION 1 The RuntimeException class is a subclass of the Exception class. Fill in the blanks to complete the declaration of the RuntimeException class. public

QUESTION 1

The RuntimeException class is a subclass of the Exception class. Fill in the blanks to complete the declaration of the RuntimeException class.

public class ________ _________ _________

QUESTION 1 The RuntimeException class is a subclass of the Exception class.

QUESTION 3

RuntimeException is a subclass of Exception. The constructor RuntimeException(String message) calls the parent class's constructor with the message argument. Which of the following makes the call correctly?

a.

this(message);

b.

super(message);

c.

super.Exception(message);

d.

Exception(message);

QUESTION 4

RuntimeException has overloaded constructors: the 1-argument constructor RuntimeException(String message) and the 2-argument constructor RuntimeException(String message, Throwable cause).

The 2-argument constructor calls the 1argument constructor with message as the argument. Which of the following makes the call correctly?

a.

this(message);

b.

RuntimeException(message);

c.

this.RuntimeException(message);

QUESTION 5

RuntimeException is a sublcass of Exception. Both classes have a constructor that takes a String argument. Among the statements below, indicate all that are syntactically correct. (multiple if necessary)

a.

Exception e = new Exception("Division by zero problem");

b.

Exception e = new RuntimeException("Division by zero problem");

c.

RuntimeException e = new Exception("Division by zero problem");

d.

RuntimeException e = new RuntimeException("Division by zero problem");

QUESTION 6

Payable is an interface with one method payableAmount() that returns double.

(1) The source code of the interface is saved in a file named ______.java

(2) Fill in the blanks to complete code for the interface:

public ______ Payable {

public abstract ______ payableAmount();

}

QUESTION 7

The Student class implements the Payable interface without actually implementing the only payableAmount() method declared in the interface. Fill in the blanks to complete the declaration of the Student class:

public ______ class ______ ______ ______

QUESTION 8

SQLException is unchecked exception, hence handling such exception is optional.

True

False

QUESTION 9

An abstract class can have constructors even though it cannot be instantiated.

True

False

QUESTION 10

In Java, a class can implement more than one interface.

True

False

QUESTION 1 The RuntimeException class is a subclass of the Exception class. Fill in the blanks to complete the declaration of the RuntimeException class. public class QUESTION 2 RuntimeException is a subclass of Exception. Which of the following is the correct UML class diagram that represents the relationship between the two classes? Exception Exception Kuntime Exception RuntimeException RuntimeException Exception Exception RuntimeException 2.(2) 3.(3) 0 4.(4)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!