It's not "int var[1];" that is causing the problem - this is variable declaration, and this is fine. The problem is in "arr[0]=1;" - this assignment is program code that cannot be executed outside of the function.
I've been working on my Code Battle program again. I've got multiple variables within and outside of the constructor. I just wanted to get an array there and can't get that to work. Why would "int var[1];" work different than "int var;? Double standard?
@krzys_h I did switch to the dev via the link you provided but the issue is still there. The folowing code does not compile: "public class cls { int arr[1]; arr[0]=1; }" The error displayed is nonsensical: "type declaration missing" on line "arr[0]=1" .
Has something happened to our forum security? I've just deleted a second spammer from the last 2 weeks. The first one at least was a little bit original, it posted a link in Shoutbox.