Javascript and java are two languages, except for "java ".
Javascript and Java are two different products developed by two companies. Java is a new-generation object-oriented programming language released by SUN, which is especially suitable for Internet application development. javascript is a product of Netscape, and its purpose is to expand the Netscape Navigator function, developed an object-and event-driven explanatory language that can be embedded into Web pages, its predecessor is Live Script, and Java's predecessor is the Oak language. The similarities and differences between the two languages are compared as follows:
1) object-based and object-oriented:
Java is a real object-oriented language. Even a simple program must be designed.
Javascript is a scripting language that can be used to create complex software that is unrelated to the network and interacts with users. It is an Object-Based and Event Driver-Based programming language. Therefore, it provides a wide range of internal objects for designers.
2) Explanation and Compilation:
Java source code must be compiled before execution;
Javascript is an interpreted programming language. Its source code does not need to be compiled and is interpreted and executed by the browser.
3) strong type variables and weak type variables:
Java uses a strongly typed variable check, that is, all variables must be declared before compilation;
The variable declaration in javascript uses its weak type. That is, variables do not need to be declared before use, but the interpreter checks their data types at runtime.
4) The code format is different.