I am learning Java and I have some kinds of error"Exception in thread"

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);

Leave a Comment