I don't know of anything that doesn't compile, but I've found a few things
that exhibit different behaviour. The best example is the static
initialisation of classes. Using the following example:
package foo;
public class FooTest {
public static class Foobar {
static {
System.out.println("hello world");
}
}
public static void main(String args[]) {
System.out.println("Foobar=" + Foobar.class);
}
}
The 1.4 class for FooTest will invoke the static initialiser for Foobar and
do the println, but the 1.6 will not. This is using the same JVM and javac,
only varying the -source and -target: that is the emitted bytecode varies.
I assume that this change was deliberate, but it confused me at the time
when I came across it :-)
Matthew Farwell.
2012/10/2 Jon Kiparsky <[email protected]>
> Is there anything that compiles, say, under Java 4 and won't compile under
> 5,6, or 7?
>
>
--
You received this message because you are subscribed to the Google Groups "Java
Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/javaposse?hl=en.