That's why
This is a variable declaration and initialization using array initialization syntax:
int[] x = {12,34,56,78}; // this is java. my bad int x[] = {12,34,56,78}; // this is c
This is the declaraction variable:
int[] x; // java again int x[]; // this is c
You are allowed to initialize a variable (which includes the use of array initialization syntax) when declaring a variable.
This is the assignment of a variable with a syntax error:
x = {12,34,56,78};
Dwb source share