format output with printf
807598May 18 2006 — edited May 23 2006I'm currently taking a Java programming class using Java version 1.5.0_06 for my class.
I'm running into problems with the printf statements. Can someone help me figure out what's wrong with this statement?
outFile.printf("%-26s $ %12.2f%n", "Assessed Value:", assessVal);
Basically, I want the output to print, for example:
Assessed Value:********* $ 1000000.00 (* denotes spaces)
This is the error message I get when running it:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The method printf(String, Object[]) in the type PrintWriter is not applicable for the arguments (String, String, double)
Any help is appreciated.
ntjava