java - String.format() is not working? -


here code:

timeformat = string.format("%02d:%02d:%02d",hoursformat, minsformat, secsformat); 

hoursformat, minsformat, , secsformat ints

this gives compilation error:

unresolved compilation problem:      method format(string, object[]) in type string not applicable arguments (string, int, int, int) 

does know why string.format() not working way?

i had similar problem printf. using jdk 1.6.0_27. setting compliance level 1.6 solved issue. can set in following way.

project > properties > java compiler

you can refer following thread:

why getting compilation errors simple printf?


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -