I
Iwan
Hi,
What is the best way to initialize an new integer array?
(performance, readability, etc..)
int[] integers = {1, 2, 3};
or
int[] integers = new int[] {1, 2, 3};
note: first syntax will fail when assigning a value to the array
int[] integers;
integers = new int[] {1, 2, 3}; // OK
integers = {1, 2, 3}; // Error
greetz,
Iwan Bel
What is the best way to initialize an new integer array?
(performance, readability, etc..)
int[] integers = {1, 2, 3};
or
int[] integers = new int[] {1, 2, 3};
note: first syntax will fail when assigning a value to the array
int[] integers;
integers = new int[] {1, 2, 3}; // OK
integers = {1, 2, 3}; // Error
greetz,
Iwan Bel