Imagem de fundo

Considere a classe Java a seguir:public class Teste{public...

Considere a classe Java a seguir:


public class Teste{


public static int opera(int v[], int n) {

int i;

if (n > 1) {

for (i = 1; i < n; i++) {

if (v[i - 1] > v[i]) {

return 0;

}

}

}

return 1;

}

public static void main(String[] args) {

int[] x = {10, 15, 11, 4, 2, 7};

System.out.println(“Resultado=”+opera(x, x.length));

}

}

O método chamado opera


A

lançará uma exceção do tipo ArrayIndexOutOfBoundsException.


B

troca os valores contidos no vetor x[0..n-1] por zeros.


C

verifica se o vetor x[0..n-1] está em ordem crescente.


D

coloca os elementos do vetor x[0..n-1] em ordem crescente.


E

verifica se o vetor x[0..n-1] está em ordem decrescente.