import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int[] vet = new int[2];
int i;
for (i=0; i<2; i++); {
System.out.println("Digite um numero");
vet[i] = sc.nextInt();
}
for (i=0; i<2; i++);{
System.out.println(vet[i]);
}
sc.close();
}
}
Dá um erro na linha vet[i] = sc.nextInt();
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2 at Main.main(Main.java:12)