compiler-design-eth/javali_tests/HW4_nop90/Array/ErrArrayIndex.javali

13 lines
213 B
Text
Raw Normal View History

2020-01-15 22:34:57 +01:00
/* Test accessing arrays with invalid index*/
class Main {
void main() {
int[] x;
x = new int[5];
x[0] = 3;
x[1] = 4;
x[2] = 5;
x[5] = 5; //this should fail
}
}