Limited access

Upgrade to access all content for this subject

Consider the following code segment.

String[] states = {"Vermont", "Wyoming", "Virginia", "Kentucky", "New York", "Ohio"};
int x=0;

while (x<states.length)
{
    states[states.length-x-1] = states[x]+states[states.length-x-1];
    x++;
}

What string value does states[2] point to after this code segment is executed?

A
WyomingNew YorkWyoming
B
VirginiaKentucky
C
KentuckyVirginia
D
KentuckyVirginiaKentucky
E
VirginiaKentuckyVirginia
Select an assignment template