The method printf(String, Object[]) in the type PrintStream is not applicable for the arguments (...)
Check that the Compiler compliance level
is set to at least 1.5 for your project:
Project > Properties > Java Compiler
if Enable project specific settings
is not set, use the Configue Workspace Settings...
link on that page to check the global Compiler compliance level
.
Eclipse Java printf issue PrintStream is not applicable
Turns out the project folders in Eclipse run on their own properties seperate from the Eclipse main settings .. in order for them to compile on version 1.6/1.7/1.8 you have to change their properties seperatly from the main settings...
Basically instead of going to windows > preferances ... to change and update the compiler version you right click on the project folder in Package Explorer > Properties > Java Compiler then check the Enable project specific settings and then Change the settings below to the compiler compliance level of 1.5 or higher in order for this code above to work.
Why it does that i have no idea makes no sence but it at least works now :)
The method println(int) in the type PrintStream is not applicable for the arguments (String, int, int, int)
Try
System.out.println(num1+" x "+num2+" = "+result+"\n");
UPDATE: Some of you are saying this concatenation method is slower than other methods. You are right, it is slower, but does it really matter for this example?
This method is usually used to debug, not as part of the final code, and usually only once or twice on the whole code.
Faster method:
System.out.printf("%d x %d = %d\n",num1,num2,result);
Java: printf is not applicable for the arguments (String, double)
Is it possible that you hav Java compiler compliance level 1.4?
Related Topics
How to Get the Filename Without the Extension in Java
Eclipse Kepler for Os X Mavericks Request Java Se 6
In Log4J, Does Checking Isdebugenabled Before Logging Improve Performance
How to Get the Threadpoolexecutor to Increase Threads to Max Before Queueing
Different Types of Thread-Safe Sets in Java
Difference of Maven Jaxb Plugins
Difference Between & and && in Java
Persistence Unit as Resource_Local or Jta
How to Set the Jdk Netbeans Runs On
Faster Alternatives to Java's Reflection
System.Currenttimemillis() VS. New Date() VS. Calendar.Getinstance().Gettime()
Why Does Stream<T> Not Implement Iterable<T>
Tool for Analyzing Large Java Heap Dumps
How to Programmatically Set the Sslcontext of a Jax-Ws Client
How to Negate a Method Reference Predicate
Replacing All Non-Alphanumeric Characters with Empty Strings