volatile
volatile

Reputation: 179

JVM backward compatibalitty

If I have class A that is compiled in Java 1.6 I have class B that is compiled in Java 1.7 In its main method class A invokes a method of class B.

If I run class A under java JVM of version 1.7, everything works well. May I get an explanation for that?

Upvotes: 1

Views: 51

Answers (1)

Prim
Prim

Reputation: 2968

All classes compiled under java version 1.6, is supported and runnable by java version 1.6+, including version 1.7, 1.8, etc.

On the other hand, you can't run a program compiled in java 1.7 with a 1.6-JRE.

It's the backward compatibality principle

Upvotes: 1

Related Questions