Limited access

Upgrade to access all content for this subject

Consider the following code segment.

int[] myArray = {0,4,9,-16}; 
myArray[0]=myArray[3]; 
myArray[3]=myArray[0]; 
System.out.println(myArray[3]*-2);

What is printed as a result of executing the following code segment?

A

0

B

8

C

18

D

32

E
ArrayIndexOutOfBoundsException
Select an assignment template