Is it right to say that "Java is platform independent, but version dependent?"

Our project application uses Java 5, and now when I update Java 6, there is some inconsistency with the functionality and, seeing this effect, our manager commented that "Java is platform independent, but version dependent" , is that true?

+3
source share
4 answers

Newer versions of Java will run code compiled in previous versions. Therefore, if you compile your code in Java 5 and then try to run it in the Java 6 environment, it will run.

If you are compiling in Java 6, although it will not work in Java 5.

+3
source

Java SE :

Java, Edition (Java SE) Java. Java SE , , . Java SE , : Java SE API, Java.

.

, , Java SE , ( ). , ( ). (, , API ..), . , , () . .

+1

, - , , , , .

There is nothing that suggests that JDK6 will work like JDK5 anytime. For example, it seems that the order in HashMap will be different between the two versions, but since the HashMap is disordered, this is not a real problem unless you expect the order to be consistent.

0
source

Sometimes new versions of Java introduce new Java features. However, maintaining backward compatibility at all times is notoriously difficult, and code written for newer versions of Java cannot work with older versions of the runtime.

0
source

Source: https://habr.com/ru/post/1720850/


All Articles