System.out.printf [message #50610] |
Mon, 11 April 2005 10:23  |
Eclipse User |
|
|
|
Originally posted by: tleira.sprynet.com
Hello all:
Perhaps someone can help me figure out my problem which is when I type for
example:
System.out.printf( "Enter deposit amount for account2: ")
depositAmount = input.nextDouble();
eclipse underlines the word "printf" and says the following:
Exception in thread "main" java.lang.Error: Unresolved compilation
problems:
The method printf(String, Object[]) in the type PrintStream is not
applicable for the arguments (String, double)
When I compile this same program with note pad it works fine but for some
reason eclipse does,nt like printf. If I use println ot print it works
fine, any suggestions and solutions would be very much appreciated.
Tnx
Tim Leira
|
|
|
|
Re: System.out.printf [message #51306 is a reply to message #50610] |
Tue, 12 April 2005 18:16  |
Eclipse User |
|
|
|
Originally posted by: john.eclipsefaq.org
The printf method was added in Java 1.5. Are you sure you are compiling
inside Eclipse against a 1.5 VM? This is configured under Preferences >
Java > Installed JREs.
--
Tim Leira wrote:
> Hello all:
> Perhaps someone can help me figure out my problem which is when I type
> for example:
>
> System.out.printf( "Enter deposit amount for account2: ")
> depositAmount = input.nextDouble();
>
> eclipse underlines the word "printf" and says the following:
>
> Exception in thread "main" java.lang.Error: Unresolved compilation
> problems: The method printf(String, Object[]) in the type
> PrintStream is not applicable for the arguments (String, double)
>
> When I compile this same program with note pad it works fine but for
> some reason eclipse does,nt like printf. If I use println ot print it
> works fine, any suggestions and solutions would be very much appreciated.
>
> Tnx
> Tim Leira
>
|
|
|
Powered by
FUDForum. Page generated in 0.04935 seconds