Home  >  Article  >  Java  >  The difference between java and javascript

The difference between java and javascript

(*-*)浩
(*-*)浩Original
2019-11-11 10:04:564754browse

JavaScript and Java are two different products developed by two companies.

The difference between java and javascript

Java is an object-oriented programming language launched by the original Sun Microsystems company, which is particularly suitable for Internet application development; (Recommended to learn : java course)

And JavaScript is a product of Netscape. It is an object-based and event-driven interpretation developed to extend the functions of the Netscape browser that can be embedded in Web pages. Sexual language.

The predecessor of JavaScript is LiveScript; and the predecessor of Java is Oak language.

The following is a comparison of the similarities and differences between the two languages:

Object-based and object-oriented:

JAva is a true object-oriented language. Even to develop simple programs, objects must be designed; JavaScript is a scripting language that can be used to create complex software that has nothing to do with the network and interacts with users.

It is an Object-Based and Event-Driven programming language, so it itself provides a very rich set of internal objects for designers to use.

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. (Nearly all current browsers use JIT (just in time compilation) technology to improve the running efficiency of JavaScript)

Strong type variables and type weak variables:

Java uses strong type variable checking, that is, all variables must be declared before compilation; variables in JavaScript are weakly typed, and even variables do not need to be declared before using them. The JavaScript interpreter checks and infers its data type at runtime. .

The code format is different.

The above is the detailed content of The difference between java and javascript. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn