Hi all there,
I was reading a book on Java and came across this piece of code. Now, I am not sure how line 13 works especially, these symbols after the equal signs "passed=%d; failed=%d%n" . How do the symbols affect the output of the variables(passed & failed)? so let's say they are left out, then we won't get any values printed out.
What are they called? Are they operators or something like that? Any link you'd share that has a list of them?
Anyone has a minute or two to explain that to me? Thanks in advance.
int passed = 0;
int failed = 0;
for (String className : args) {
try {
Class c = Class.forName(className);
c.getMethod("test").invoke(c.newInstance());
passed++;
} catch (Exception ex) {
System.out.printf("%s failed: %s%n", className, ex);
failed++;
}
}
System.out.printf("passed=%d; failed=%d%n", passed, failed);