int num; String numx; // compiler states that numx isn't initialised. for (int count=0;count<4;count++){ num = (int)(Math.random()*9); numx += num+" "; }
I realised I have to insert a arbitrary String numx=""; for it to work.
Why is this so ?
I know that a local variable must be declared before it can be used, but does it need to be initialised before use as well ?