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:

Windows 8.3 file naming setting is disabled for the product

To enable Windows 8.3 file naming setting use fsutil command Example:  c:\> fsutil 8dot3name set C: 0