1. ホーム
  2. java

[解決済み] java.util.UnknownFormatConversionException が発生しました。

2022-02-08 22:36:19

質問

  System.out.printf("%s%13s%\n", "TarrifType", "AnnualCost");
  System.out.printf("%s%d.%n", "String" 243.08);

    Exception in thread "main" java.util.UnknownFormatConversionException: Conversion = '
at java.util.Formatter.checkText(Unknown Source)
at java.util.Formatter.parse(Unknown Source)
at java.util.Formatter.format(Unknown Source)
at java.io.PrintStream.format(Unknown Source)
at java.io.PrintStream.printf(Unknown Source)
at ModelComparison.main(ModelComparison.java:12)

何が問題なのか、何か思い当たることはありますか?

解決方法は?

不具合は?

System.out.printf("%s%13s\n", "TarrifType", "AnnualCost");
System.out.printf("%s%f\n", "String", 243.08);

http://ideone.com/USOx1