Home:ALL Converter>Why Am I Getting An Error In PrintF?

Why Am I Getting An Error In PrintF?

Ask Time:2014-07-06T20:08:36         Author:IceWreck

Json Formatter

I am getting an error in PrintF in the following java code. The Error Is :

The method printf(String, Object[ ]) in the type PrintStream is not applicable for the arguments (String, int)

The Code Is :

    public class MyClass {

    public static void main(String[] args) {

        for (int i = 0; i < 5; i++) {

            System.out.printf("The value i is: %d", i); 
        }
      }
   }

Why am I getting this error? I think I have written the code correct but why is eclipse considering it as an error ? What can i do to remove this error ? I have 64 Bit JDK 8 | Windows 7|Eclipse 4.3 Kelper |

Author:IceWreck,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/24595651/why-am-i-getting-an-error-in-printf
yy