Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 ________ _________ _________

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago