I am using Java 1.7 in my code, now i want to replace JAVA 1.7 to JAVA 1.8.Is Java 1.8 compatible to Java 1.7. ?
Will it work as it before. i mean, all new features of Java 1.8 can be used in the existing piece of code?
2 Answers 2
The existing piece of code will (ipso facto) not be using any new features of Java 8. If you have a piece of code which works1 on Java version v, it will also work on all other versions v'> v. That is the long-standing promise of the Java platform.
1 By "works" I mean "works as specified, using non-deprecated official JDK APIs".
3 Comments
It depends.
Your question is a little unclear. "Will it work as before" and "All new features of Java 8 can be used in the existing piece of code" seem mutually exclusive.
If you are using a Lambda Expression (Java 8 feature) you will not be able to compile using JDK7. Conversely if you are compiling using JDK7 you will not be able to use any of the new features in JDK8.
TL;DR: If you have to ask, it probably won't.
Thread#stopwill be removed---not its declaration, but its implementation. I don't know of any other examples, though.Thread#stop(Throwable)overload has been removed. Reference: cs.oswego.edu/pipermail/concurrency-interest/2013-July/…