In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces "what are the differences between java and javascript". In daily operation, I believe many people have doubts about the differences between java and javascript. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "what are the differences between java and javascript?" Next, please follow the editor to study!
Differences: 1, javascript is object-based, Java is object-oriented; 2, javascript does not need to be compiled before sending to the client for execution, but java needs; 3, variable declaration in js uses weak types, Java uses strong types; 4, js uses dynamic binding, Java uses static binding, and so on.
The operating environment of this tutorial: windows7 system, javascript1.8.5&&java8 version, Dell G3 computer.
The differences between javascript and Java are mainly shown in the following aspects:
1. Javascript is object-based and Java is object-oriented.
Javascript is object-based, it is a scripting language, and 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.
2. 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.
3. The code format of javascript is different from that of Java.
Javascript code 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 * .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 * .class.
4. 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.
5. Dynamic binding is used in javascript and static binding is used in Java.
Javascript uses dynamic binding, that is, object references to javascript are 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.
6. Different ways of operating text and graphics
Javascript does not manipulate text and graphics directly, it works with combinations of HTML elements in Web pages, but it controls the browser and allows browsers to process text and graphics directly. On the other hand, Java can manipulate text and graphics directly.
7. Javascript and Java are different products developed by different companies
Javascript is a product of Netscape, which aims to extend the function of Netscape Navigator and develops an object-based and event-driven interpretive language that can be embedded in Web pages.
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.
At this point, the study on "what is the difference between java and javascript" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.