Reputation: 407
I defined an array as follows:
int[][] temp_blocks = new int[dim][dim];
But I got a warning:
Name 'temp_blocks' must match pattern `^[a-z][a-zA-Z0-9]*$|^[A-Z][A-Z_0-9]*$`.
Any idea why it is that, and how to fix it?
Upvotes: 0
Views: 258
Reputation: 413
The compiler is telling you that names of variables must match the regular expression ^[a-z][a-zA-Z0-9]*$|^[A-Z][A-Z_0-9]*$
. This regular expression states that there are two types of variables names:
Variables starting with a lowercase letter. These can contain lowercase letters, uppercase letters, and digits.
Variables starting with an uppercase letter. These can contain uppercase letters, digits, and underscores.
Your variable name temp_blocks
doesn't fit these conditions since it starts with a lowercase letter but contains an underscore.
Upvotes: 1