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

11 lines
179 B
Text
Raw Normal View History

2020-01-15 22:34:57 +01:00
/* Test access an array on a null pointer */
class Main {
void main() {
int[] x;
x = null;
x[1] = 5; //this should throw null pointer exception
}
}