First, they are the two different products developed by the two companies, and Java is a new generation of object-oriented programming language from Sun, which is especially suitable for Internet application development.
Second, JavaScript is Object-based, and Java is Object-oriented, meaning that Java is a true object-oriented language, and even if you are developing a simple program, you must design the object.
JavaScript is a scripting language that can be used to create complex software that is independent of the network and interacts with the user. It is an object-and event-driven programming language.
Thirdly, the two languages do not perform the same way in their browsers. Java's source code must be compiled before it is passed to the client, so the client must have an emulator or interpreter on the appropriate platform.
It can be implemented by a compiler or interpreter that is independent of the binding of a particular platform compiler code. JavaScript is an explanatory programming language whose source code does not need to be compiled before it is sent to the client.
The variables adopted in the two languages are not the same. Java uses strongly typed variables to check that all variables must be declared before they are compiled. A variable declaration in JavaScript with its weak type.
That is, the variable does not need to be declared before it is used, but rather the interpreter checks its data type at run time.
Five, the code format is not the same. Java is an HTML-independent format that must be loaded by referencing an external media like HTML, and its code is stored in a separate document in the form of a byte code.
Six, the embedding method is different. In an HTML document, the identities of the two programming languages are different, JavaScript uses <script>...</script> to identify, and Java uses <applet> ... </applet> to identify.
VII, static binding and dynamic binding. Java uses static linking, meaning that Java object references must be made at compile time, so that the compiler can implement strong type checking. JavaScript uses dynamic linking,
That is, JavaScript object references are checked at run time and cannot be checked for object references without compiling.
The difference between JavaScript and Java