52.2k views
2 votes
Write a statement that declares a reference variable abend suitable for holding a reference to an Exception object and initialize it to an Exception object whose message is "ABEND 013".

1 Answer

3 votes

Answer:

Exception abend = new Exception( "ABEND 013");

Explanation:

There are few ways of declaring and initialising a variable.

First, the variable is Initialised along side the declaration statement.

Second, the variable is first declared on a line then Initialised on another line.

The syntax for (1) is

Variable-type Variable-name = new Variable-type ("value");

With this, the question becomes

Exception abend = new Exception( "ABEND 013");

User Enlil
by
3.5k points