please clarify

public class Test {

public static void main(String[] args) {

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

}

}

In the above code, what does this %d, %s, and %n means. And what else are there in java and where I can get the more details. I got this example in one of the java sites. It is working fine.

Thanks in advance.

[717 byte] By [srisria] at [2007-10-3 4:50:10]
# 1

Look at the java.lang.System class API to see what class the System.out variable is. Then lookup that class's API to see what printf does.

Have you ever written code to format output in C? If you have, you should recognize what printf does (I don't know if it is exactly the same in Java, but it is similar).

Link to Java API is below. Search for "System" in the lower left frame, then do as I said above.

http://java.sun.com/j2se/1.5.0/docs/api/

MLRona at 2007-7-14 22:54:44 > top of Java-index,Java Essentials,Java Programming...
# 2
Thank you very much. The details are given in the below link in the API:/docs/api/java/util/Formatter.html#syntaxI never learned any programming language before. If at all I am learning any programming language, it is Java only.
srisria at 2007-7-14 22:54:44 > top of Java-index,Java Essentials,Java Programming...