i have a question regarding java int array initialization. i want to set the widths base on conditions, but when i try to compile it says malformed declaration. Anything wrong with my array initialization?
int []widths;
if(condition 1)
{
widths = {1,4,5,3};
}
if(condition 2)
{
widths = {1,9,5,3,2};
}
method1.setWidth(widths ); //method that take int array as argument.