System.out.println and String arguments

java, println

Solution

The two that work only take one parameter, the one that fails takes two. Any chance you have a Javascript or Python background? Java enforces parameter type and count (like C).

Try

`System.out.println("Give grade: " + args[0]);`

or

`System.out.printf("Give grade: %s%n", args[0]);`

Problem

When I write: ``` System.out.println("Give grade: ", args[0]); ``` It gives the error: The method println(String) in the type PrintStream is not applicable for the arguments (String, String). Why is this so? However, when I try to write ``` System.out.println("Give grade :"); System.out.println(args[0]); ``` No error shows. Is there a way I can write the above in one line of `println()`?

Original source