Java syntax array -
i can never find code perform:
functionname(new float[]{factor});
is array declaration? mean:
new float[]{factor}
it equal to
float[] arrayname = new float[factor];
?
new float[]{factor}
is 1 type of array declarations in java. creates new float array factor value in it.
another ways how can declare arrays:
for primitive types:
int[] myintarray = new int[3]; int[] myintarray = {1,2,3}; int[] myintarray = new int[]{1,2,3};
for classes, example string, it's same:
string[] mystringarray = new string[3]; string[] mystringarray = {"a","b","c"}; string[] mystringarray = new string[]{"a","b","c"};
Comments
Post a Comment