Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

format output with printf

807598May 18 2006 — edited May 23 2006
I'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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 20 2006
Added on May 18 2006
15 comments
491 views