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"}; 

source how declare , initialize array in java?


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -