JavaScript and Java Differences Introduction Java how to _java

Source: Internet
Author: User

Java and JavaScript look so much alike, are they the same thing? Now let me reveal the answer!

JavaScript is an embedded script file that is inserted directly into a Web page and is executed by the browser while interpreting it.

The Java language is not the same, he must be running on a Java virtual machine. And it needs to be compiled beforehand.

Java's syntax rules are much stricter than JavaScript, and the functionality is much more powerful.

First of all, the two guys were not in any relationship, Java was launched in May 1995 by Sun, and JavaScript was designed by Netscape in 1995, because of Netscape's collaboration with Sun, The top Netscape wants it to look like Java, so it's named JavaScript.

Second, the nature of the two guys is different, Java is an object-oriented programming language that can compose cross-platform applications, and you must design objects even if you are developing simple programs, and JavaScript is a literal-translation scripting language that itself provides a very rich internal object for designers to use.

And they are executed differently, Java is a language between the interpretation and the compiled language, Java source code in the delivery to the client before the implementation, must be compiled, through the corresponding platform of the interpreter, to achieve independent of a particular platform to compile code constraints. JavaScript is an interpretative programming language whose source code does not need to be compiled before it is sent to a client, but instead sends a text-formatted character code to the client for interpretation by the browser.

Second, the use of the two is also different, Java is widely used in personal PCs, data centers, game consoles, science supercomputers, mobile phones and the Internet, and the use of JavaScript is: 1. Embed dynamic text in HTML page; 2. respond to browser events; 3. Read and write HTML elements; 4. Verify the data before the data is committed to the server; 5. Detect visitor's browser information; 6. Control cookies, including creation and modification.

The above is a small set of JavaScript and Java to introduce the difference between the introduction, learn Java how, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.