Reputation: 170
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 typeString
is 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?
Upvotes: 0
Views: 44
Reputation: 280181
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
Upvotes: 3