[ajug-members] The method format(String, Object[]) in the type Formatter is not applicable for the arguments (String, String, int)

Björn Gustafsson bjorng at gmail.com
Thu Aug 9 17:47:20 EDT 2007


Which Formatter class are you using? As I recall, java.util.Formatter
was new in Java 1.5.  I wouldn't think they'd intentionally change its
behavior in 1.6, so maybe the "..." syntax is broken?  I can see how
it might also be a boxing/unboxing failure, i.e. if you repackaged the
int as an Integer it might succeed.  (Though that'd still be a bug.)

On 8/9/07, Christopher Fowler <cfowler at outpostsentinel.com> wrote:
> I'm compiling a program in Java 1.6 that I've always have been able to
> compile  in 1.4.  I'm not getting this error that I'm not sure how to
> fix:
>
>         formatter.format("%s%06d", prefix, i);
>                   ^^^^^^
> The method format(String, Object[]) in the type Formatter is not
> applicable for the arguments (String, String, int)
>
> It seems to me that they've may have changed the conventions used by
> printf to their own?



More information about the ajug-members mailing list