If you want to initialize an array in a constructor, you can't use those array initializer like.
data= {10,20,30,40,50,60,71,80,90,91};
Just change it to
data = new int[] {10,20,30,40,50,60,71,80,90,91};
You don't have to specify the size with data[10] = new int[] { 10,...,91}
Just declare the property / field with int[] data;
and initialize it like above.
The corrected version of your code would look like the following:
public class Array {
int[] data;
public Array() {
data = new int[] {10,20,30,40,50,60,71,80,90,91};
}
}
As you see the bracket are empty. There isn't any need to tell the size between the brackets, because the initialization and its size are specified by the count of the elements between the curly brackets.