There are two problems.
First, your printf
is expecting 4 arguments, but you are supplying only one.
Second, %d
says you are expecting the argument to be a number, but you are providing a String.
System.out.printf("%d%n%d%n%d%n%d%n", 1, 2, 3, 4);
More Related Contents:
- try/catch with InputMismatchException creates infinite loop
- Text wrap in JOptionPane?
- UnsupportedOperationException when trying to remove from the list returned by Array.asList
- java.sql.SQLException: Access denied for user ‘root’@’localhost’ (using password: YES)
- How to read and understand the java stack trace? [duplicate]
- How to define custom exception class in Java, the easiest way?
- How to fix java.net.SocketException: Broken pipe?
- In Java, when should I create a checked exception, and when should it be a runtime exception? [duplicate]
- Why doesn’t Java allow generic subclasses of Throwable?
- How can I write custom Exceptions?
- How do you assert that a certain exception is thrown in JUnit tests?
- How do I increase the number of displayed lines of a Java stack trace dump?
- Handling Java crypto exceptions
- JDBC driver throws “ResultSet Closed” exception on empty ResultSet
- How to parse number string containing commas into an integer in java?
- What is difference between Errors and Exceptions? [duplicate]
- java.net.MalformedURLException: no protocol
- org.hibernate.MappingException: Unknown entity: annotations.Users
- How can I throw a general exception in Java?
- PKIX path building failed in Java application
- javax.crypto.BadPaddingException
- How can I detect when an Exception’s been thrown globally in Java?
- Exception without stack trace in Java
- String index out of bounds exception java
- Why does TreeSet throw a ClassCastException?
- Catching an exception that is nested into another exception
- Java InputMismatchException
- Is it a bad idea to use printStackTrace() for caugt Exceptions?
- The local variable might not have been initialized – Detect unchecked exception throw within a method
- org.openqa.selenium.UnhandledAlertException: unexpected alert open