I'm trying to add an actual percent sign into a printf statement in Java and I'm getting the error:
lab1.java:166: illegal escape character
System.out.printf("%s%s%1.2f\%%1.2f\%
",ID,pattern,support,confidence);
^
lab1.java:166: illegal escape character
System.out.printf("%s%s%1.2f\%%1.2f\%
",ID,pattern,support,confidence);
^
2 errors
I can't figure out how to put an actual percent sign into my printf? I thought using \% to escape it would work, but it isn't.
Any ideas?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…