Playing Compiler
Find the error(s) in each of the following code segments.
a. char[] a = new char[10];
a[10] = ‘s’;
a[9] = 76;
b. char[] a = new char[10];
char[9] = ‘s’;
c. char[] a = new int[10];
a[0] = ‘s’;
a[1] = 80;
d. int[] a;
a = new int[255];
a[0] = ‘s’;
a[a[0]] = 35;
a[35] = 12345654321;
e. int[] a;
a = new int[255];
a[0] = a.length;
a[0] −−; a.length−−;
a[a[0]] = 2;
f. int[] b = new int[9];
int[ ][ ] a;
a = new int[255][ ];
a[0] = b;
a[0][3] = 9;
a[3][0] = 9;
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.