Today's quiz has to do with the -source and -target command line switches of the javac command. We are all familiar with these switches.
But do we really know how they work?
Suppose I have just built a new Debian 4.0 box, and installed Sun Java 5 on it. There are no other versions of Java installed on the box. Without actually invoking the compiler, answer the following question.
Will the following Foo.java:
public class Foo {
public static void main(String[] args) {
StringBuilder sb = new StringBuilder();
sb.append("Hello, world.\n");
System.out.println(sb.toString());
}
}
compile successfully with the following command line: