asked 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");

answered
User Enlil
by
8.5k points
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.