For an application, I am trying to initialize an int variable to 3_745_000. However, at any time when I try to compile, I am given ';' the expected error with the first underscore and the expected identifier error in the actual half of the colon. As far as I know, this is a completely legal use of underscores in Java, so I don't understand why I am getting the error. This is the code.
private static int lastacct = 3_745_000;
They give me the same error, no matter where I try to put the underscore.
source
share