[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.newcomer] Re: System.out.printf

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