The exception asks you for an array instead comma-sepparated strings:
// incorrect
String.format("%02d:%02d:%02d",hour,minute,second);
// fast but correct
Object[] data = { hour, minute, second };
String.format("%02d:%02d:%02d", data);
But actually, method format(String,object[]) does not exists in String, it is: format(String pattern, Object... arguments) what should work with commas ,. There is something with your syntax, but not in the shown code.
The exception asks you for an array instead comma-sepparated strings:
// incorrect
String.format("%02d:%02d:%02d",hour,minute,second);
// fast but correct
Object[] data = { hour, minute, second };
String.format("%02d:%02d:%02d", data);
But actually, method format(String,object[]) does not exists in String, it is: format(String pattern, Object... arguments) what should work with commas ,. There is something with your syntax, but not in the shown code.
A real answer to this problem is only your type int. You don't have to use Object specifically but you have to use a type that inherit from Object and int is a raw type that does not inherit from Object, like all raw types. So you can use Integer instead of int to solve your problem.