Question: java 1. We would test whether a parseInt() failed due to a NumberFormatException by: A using an if statement block that appeared after the parseInt()

java

1. We would test whether a parseInt() failed due to a NumberFormatException by:

A using an if statement block that appeared after the parseInt() statement.
B placing the parseInt() call in the try portion of a try/catch block.
C using a try/catch block that appeared after the parseInt() statement.
D

placing the parseInt() call in the catch portion of a try/catch block.

A constructor is used to:

a ... initialize the instance members of a class.
b ... declare the member variables of a class.
c ... initialize the static members of a class.
d

... initialize both instance and static members of a class.

3. Consider the following 2-D array allocation:

 Dog[][] lilikoi = new Dog[4][6]; 

Check the true statements.

A The original array declaration, with no additional instantiation, will create 24 Dog objects.
B for ( row = 0; row < lilikoi.length; row++) for ( col = 0; col < lilikoi[row].length; col ++) lilikoi[row][col] = new Dog();

will instantiate 24 objects for array lilikoi[][].

C The original array declaration, with no additional instantiation, will create 24 doubles.
D lilikoi[][] is considered to have 4 rows and 6 columns

E We can redefine the Dog object in the bottom row and right-most column of lilikoi[][] using the notation:

 lilikoi[4][6] = new Dog();
F The original array declaration, with no additional instantiation, will create 24 Dog references.

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!