Let’s take a bit of wikipedia and similar content to give a “historical” context before going into more technical matters.
It is an object-oriented programming language created in the early nineties of the twentieth century by the company Sun Microsystem and acquired by Oracle in 2010 in order to offer programmers the ability to write the code only once and can run it on any device; for this Java Virtual Machine – JVM was developed that makes the language portable to all platforms.
It was created in the middle of that decade by the company Netscape in order to provide greater interactivity to web pages viewed with Netscape Navigator, a web browser owned by the company and leading the market at that time; The Java word used at the beginning of the name was a strategy to take advantage of Java marketing at that time.
Both languages except for the similarity of the word Java in their names are quite different; Then we will show some of the most notable differences between both languages:
The compilation creates an optimized file that can be read and executed by the operating system of the computer; Java programs are compiled in bytecode, an intermediate language that can only be interpreted by a JIT run that allows it to be multiplatform.
While in Java it is necessary to perform the compilation phase first, in this phase the compiler indicates the syntax errors that exist, which must be corrected in order to make a successful compilation; so when the program is executed there will be no syntax errors, however logic or other errors may occur.
Java is a strongly typed language that does not allow changes or violations in the defined data types, that is, the variables must be of a defined type and once they have been declared they can not be changed, which makes it a language not very flexible.