Search This Blog

Total Pageviews

Exception in thread "main" java.util.UnknownFormatConversionException

Exception in thread "main" java.util.UnknownFormatConversionException: Conversion = 'p'
at java.util.Formatter$FormatSpecifier.conversion(Formatter.java:2691)
at java.util.Formatter$FormatSpecifier.<init>(Formatter.java:2720)
at java.util.Formatter.parse(Formatter.java:2560)
at java.util.Formatter.format(Formatter.java:2501)
at java.util.Formatter.format(Formatter.java:2455)
at java.lang.String.format(String.java:2928)
at ProgramStack.java:39)

This is caused by not using the correct format in String.format() method.

Error code:  System.out.println(String.format("I am  a % programmer",name)) ;

Fix:  System.out.println(String.format("I am  a %s programmer","java")) ;

No comments:

You are currently using plaintext http to connect.

Npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation must use TLS 1.2 or higher. S...