当前位置: 代码迷 >> J2SE >> java.util.UnknownFormatConversionException: Conversion = '!
  详细解决方案

java.util.UnknownFormatConversionException: Conversion = '!

热度:379   发布时间:2016-04-24 13:29:17.0
Java一个简单问题
大家帮忙看看那里出问题了?

public class SecondJavaForC
{
  public static void main(String[] agrs)
  {
  System.out.printf("s%! Java程序hi","c语言Fan").println();
  }  
}

运行结果:
Exception in thread "main" java.util.UnknownFormatConversionException: Conversion = '!'
  at java.util.Formatter.checkText(Formatter.java:2500)
  at java.util.Formatter.parse(Formatter.java:2482)
  at java.util.Formatter.format(Formatter.java:2411)
  at java.io.PrintStream.format(PrintStream.java:899)
  at java.io.PrintStream.printf(PrintStream.java:800)
  at SecondJavaForC.main(SecondJavaForC.java:6)

------解决方案--------------------
字符格式有问题
s%
改改就好
  相关解决方案