0
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 type String 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?

0

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.