Skip to main content



      Home
Home » Newcomers » Newcomers » System.out.printf
System.out.printf [message #50610] Mon, 11 April 2005 10:23 Go to next message
Eclipse UserFriend
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 #50867 is a reply to message #50610] Mon, 11 April 2005 20:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Tim Leira" <tleira@sprynet.com> wrote in message
news:b17c480f1e69f35ef9e8d00c45635a5f$1@www.eclipse.org...
> 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();


In your example above, you are missing a semicolon at the end of the printf
line. Dunno if that's true of your actual code as well.
Re: System.out.printf [message #51306 is a reply to message #50610] Tue, 12 April 2005 18:16 Go to previous message
Eclipse UserFriend
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
>
Previous Topic:Line Terminators for CVS log on Mac OS X
Next Topic:class not found: SAXPARSERFACTORY
Goto Forum:
  


Current Time: Mon May 12 19:01:13 EDT 2025

Powered by FUDForum. Page generated in 0.04935 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top