Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the differences between Javascript and Jave

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly talks about "what are the differences between Javascript and Jave". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "what are the differences between Javascript and Jave"?

Javascript has nothing to do with Jave, javascript and Java are different products developed by different companies; javascript is a scripting language that runs in browsers, and Java is a language that is executed through interpretation, and the syntax rules are similar to C++.

This article operating environment: windows7 system, javascript1.8.5 version, Dell G3 computer.

What is the relationship between Javascript and Jave?

Javascript has nothing to do with Jave.

What is Javascript?

It is a scripting language that runs in browsers, and in web pages, Javascript is omnipotent:

1. You can manipulate HTML, providing a tool to change HTML at run time

two。 Events can be attached and executed, in line with the idea of event-oriented programming

3. Data validation function to verify the validity of the form data when submitting the form

4. Operation of customer browser, forward, backward, refresh, jump, open new window, print, etc.

5. You can create and use Cookies.

What is Java?

Java is a programming language developed by Sun Company. It is a language that is executed through interpretation, and the grammatical rules are similar to C++. At the same time, Java is a cross-platform programming language. The program written in Java language is called "Applet". After compiling it into a class file with a compiler, it is stored in the WWW page and marked on the HTML file. As long as the client software of Java is installed, the client can run "Applet" directly on the Internet.

Java is well suited for enterprise networks and Internet environments and has now become one of the most popular and influential programming languages in Internet. Java has many praiseworthy advantages, such as simplicity, object-oriented, distributed, interpretive, reliable, secure, structural neutrality, portability, high performance, multithreading, dynamic and so on. Java has abandoned all kinds of functions in C++ that do more harm than good and many rarely used features. Jave can run on any microprocessor, and programs developed with Java can be transmitted over the network and run on any client.

III. The origin of the name Javascript

JavaScript was originally called Mocha (Magic Card), which is the code name of this project. This name was used until before the release of Netscape2.0 beta 2 (95.11.04)-including the error box that popped up in beta 1, and the name of Mocha can also be seen. However, as early as September 18, netscape announced that it would enable a server-side script (unnamed) in LiveWire. Also because of the design of the "front and back end common script" we mentioned earlier, the language used the internal name LiveScript when beta 2 was released.

But the equally confusing thing is that, in fact, Netscape has decided to name the language "JavaScript". So in the release memo of beta 2, the language is called JavaScript, but the interface has been changed from Mocha to LiveScript. This situation continued until December 4, when netscape and sun issued a joint statement officially launching the name JavaScript. Then beta 4 was released (95.12.20), and the interface and documentation were unified.

So in fact, the name "LiveScript" can verify the life cycle of only one month (in 95.11.04-12.04). But after all, Mocha is only the name of the project code, not the name of the product, so later people traced back to the history of JavaScript, mostly only mentioned LiveScript.

IV. The difference between Java and Javascript

1. Javascript and Java are different products developed by different companies. Javascript is a product of Netscape, which aims to expand the function of Netscape Navigator, and develops an object-based and event-driven interpretive language that can be embedded in Web pages, while Java is a new generation of object-oriented programming language developed by SUN Microsystems, which is especially suitable for Internet application development. In fact, the original name of javascript is not javascript, but LiveScript, and the "Java" in the name is authorized by SUN Microsystems.

2. Javascript is object-based, it is a scripting language, it is an object-based and event-driven programming language, so it provides a wealth of internal objects for designers to use. Java is object-oriented, that is, Java is a real object-oriented language, even if you develop simple programs, you must design objects.

3. The embedding methods of javascript and Java are different. In HTML documents, the identities of the two programming languages are different. Javascript is used to identify them, while Java uses Applet to identify them.

4. Javascript and Java are executed differently in browsers. Javascript is an interpretive programming language, whose source code does not need to be compiled before it is sent to the client for execution, but sends the character code in text format to the client, that is, the javascript statement itself is downloaded with the Web page and interpreted and executed by the browser. The source code of Java must be compiled before it is transferred to the client for execution, so the client must have a simulator or interpreter on the corresponding platform, which can compile the code independently of a specific platform through the compiler or interpreter.

5. The code format of javascript is different from that of Java. Javascript code is an address format, which can be directly embedded in HTML documents and can be loaded dynamically. Writing HTML documents is as convenient as editing text files, and its independent file format is X.js. Java is an HTML-independent format that must be loaded as external media is referenced in HTML, its code is stored in a bytecode in a separate document, and its standalone file format is X.class.

6. The variables taken by javascript and Java are different. Variable declarations in javascript are weakly typed, that is, variables do not need to be declared before they are used, but the interpreter checks their data types at run time. Java uses strongly typed variable checking, that is, all variables must be declared before compilation.

7. Javascript adopts dynamic binding, that is, the object reference of javascript is checked at run time. Java uses static binding, that is, object references to Java must be done at compile time to enable the compiler to implement strong type checking.

8. Javascript does not manipulate text and graphics directly, it works with the combination of HTML elements in Web pages, but it can control the browser and let the browser deal with text and graphics directly. On the other hand, Java can manipulate text and graphics directly.

At this point, I believe you have a deeper understanding of "what is the difference between Javascript and Jave". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report