public String toMilitary()
{
return String.format("%2d:%2d:%2d", hour, minute, second);
}
This code gives the following error:
The method
format(String, Object[])in the typeStringis not applicable for the arguments(String, int, int, int)
Also, Enhanced for loop and Variable Parameters shown errors.
Is there a problem with my compiler. Should I re-install it?
Sotirios Delimanolis
281k62 gold badges718 silver badges744 bronze badges
asked Apr 18, 2014 at 17:45
julianff
1801 gold badge1 silver badge12 bronze badges
1 Answer 1
No (unless you seriously have an old compiler), go to your project Properties (right click), go to Java Compiler and set the Compiler compliance level to anything greater than 1.5
answered Apr 18, 2014 at 17:47
Sotirios Delimanolis
281k62 gold badges718 silver badges744 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-java