{{theTime}}

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:

Best Client Optimized Programming Language for Mobile Development?

Use Google's Dart language, which is Object-oriented, class-based and garbage-collected language with C-Style.  Dart can compile to eith...