I have tried to use java printf (available in jdk1.5.0_02) in the
following program:
//Fig 2.6: Welcome4.java
// Printing multiple lines in a dialog box.
public class Welcome4
{
// main method begins execution of Java appliation
public static void main(String args[])
{
System.out.printf("%s\n%s\n", "Welcome to ", "Java
Programming");
} // end method main
} //end class Welcome4
It compile fine when I compile it in cmd window using javac.exe. But when
I tried it in Eclipse, it did not compile giving an exception message:
Exception in thread "main" java.lang.Error: Unresolved compilation
problem:
The method printf(String, Object[]) in the type PrintStream is not
applicable for the arguments (String, String, String)