First, String is a Class name, not a keyword. So you are free to use it as a variable name, although it's not recommended.
Second, I don't think your statement on "java.lang.String class can not be used as a second parameter of the "instanceof" operator" is correct.
I have created a test program named T2.java, it compiles and runs as expected:
import java.util.*;
import java.util.regex.*;
import java.lang.reflect.*;
public class T2 {
public static void main(String[] args) throws Exception {
String String = "abc";
outputAll((String instanceof java.lang.String), String);
}
public static void outputAll(Object... args) {
System.out.println();
for (Object o: args) {
System.out.println(o);
}
}
public static void output(String msg, Object... args) {
System.out.println(String.format(msg, args));
}
}
SocketorFile, etc.