Section 1

Preview this deck

In Java, after an exception is handled, control resumes . This is known as the model of exception handling.

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (40)

Section 1

(40 cards)

In Java, after an exception is handled, control resumes . This is known as the model of exception handling.

Front

after the last catch block (or the finally block, if there is one), termination

Back

Which of the following statements regarding the throw point of an exception is false?

Front

It specifies the point at which the exception must be handled.

Back

All exception classes inherit, either directly or indirectly, from

Front

class Throwable.

Back

String objects are immutable. This means they ________.

Front

cannot be changed

Back

Which of the following is not included in an exception's stack trace?

Front

Instructions on handling the exception.

Back

Which superclass members are inherited by all subclasses of that superclass?

Front

protected instance variables and methods.

Back

An anonymous String ________.

Front

is a string literal

Back

Which of the following are NOT static Character methods?

Front

Character.equals(char c);

Back

Inheritance is also known as the

Front

is-a relationship.

Back

Which of the following statements about try blocks is true?

Front

The try block should contain statements that may throw an exception.

Back

Every class in Java, except ________, extends an existing class.

Front

Object

Back

To find the character at a certain index position within a String, use the method ________.

Front

charAt, with the index as an argument

Back

Which of the following statements is false?

Front

Exception handling can catch but not resolve exceptions.

Back

Polymorphism allows for specifics to be dealt with during:

Front

execution.

Back

A String constructor cannot be passed ________.

Front

int arrays.

Back

If the superclass contains only abstract method declarations, the superclass is used for

Front

interface inheritance.

Back

Polymorphism enables you to:

Front

program in the general.

Back

For which of the following would polymorphism not provide a clean solution?

Front

A program to compute a 5% savings account interest for a variety of clients.

Back

Using the protected keyword also gives a member:

Front

package access.

Back

An advantage of inheritance is that:

Front

Objects of a subclass can be treated like objects of their superclass.

Back

Exceptions can be thrown by

Front

All of the above.

Back

Which of the following is not a method of class String?

Front

toCharacterArray

Back

It is a UML convention to denote the name of an abstract class in

Front

italics.

Back

Which of the following statements about abstract superclasses is true?

Front

abstract superclasses may contain data.

Back

Non-abstract classes are called

Front

concrete classes

Back

An uncaught exception

Front

is an exception that occurs for which there are no matching catch clauses.

Back

When an exception occurs it is said to have been

Front

thrown

Back

Which of the following could be used to declare abstract method method1 in abstract class Class1 (method1 returns an int and takes no arguments)?

Front

public abstract int method1();

Back

To catch an exception, the code that might throw the exception must be enclosed in a

Front

try block

Back

Which of the following is the superclass constructor call syntax?

Front

keyword super, followed by a set of parentheses containing the superclass constructor arguments.

Back

The String method substring returns ________.

Front

a String

Back

The length of a string can be determined by ________.

Front

the String method length()

Back

Private fields of a superclass can be accessed in a subclass

Front

by calling public or protected methods declared in the superclass.

Back

Which of the following statements is true?

Front

None of the above are true.

Back

Overriding a method differs from overloading a method because:

Front

Overridden methods have the same signature.

Back

Which of the following keywords allows a subclass to access a superclass method even when the subclass has overridden the superclass method?

Front

super.

Back

A(n) class cannot be instantiated.

Front

abstract

Back

Which statement best describes the relationship between superclass and subclass types?

Front

A subclass reference can be assigned to a superclass variable, but a superclass reference cannot be assigned to a subclass variable.

Back

Which class is not a type-wrapper class?

Front

Int

Back

Which statement is true when a superclass has protected instance variables?

Front

All of the above.

Back