What does the following method do for the call printArray(a, a.length) for the array a = { 54, 23 36 }? What is wrong with this method? Fix the problem, if you can.

```
void printArray( int[] values, int n ) {
if ( n < 0 )
return;
n--;
printArray( values, n );
System.out.print( values[n] );
}

```


The method will attempt to print a[-1], resulting in an ArrayIndexOutOfBounds error.
Change the test from (n < 0 ) to (n == 0).

Computer Science & Information Technology

You might also like to view...

Which code is used to assign codes sequentially within a category?

A) classification codes B) alphabetic deviation codes C) block sequence codes D) cipher codes E) simple sequence codes

Computer Science & Information Technology

By using a digital signature, you confirm that the document or macro originated from the signer and has not been ________

A) altered B) lost C) deleted D) saved

Computer Science & Information Technology

Answer the following statement(s) true (T) or false (F)

1. When configuring a 1756-ENBT Ethernet driver using RSLinx, select an Ethernet crossover cable to connect the module and the personal computer. 2. The 1756-ENBT Ethernet driver must be configured prior to configuring the personal computer with which communication is desired. 3. Manually configuring a driver using the Ethernet devices driver can be used to display only the desired Ethernet/IP devices in RSWho. 4. If desired, the default driver name provided by RSLinx during configuration can be changed in the RSWho window. 5. In the Configure Drivers window, the word “running” listed twice for a configured driver verifies communication with the target device.

Computer Science & Information Technology

Which one of the following cryptographic algorithms supports the goal of nonrepudiation?

A. Blowfish B. DES C. AES D. RSA

Computer Science & Information Technology