In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "what is the difference between Java and JavaScript". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the difference between Java and JavaScript?"
First, different origins:
Javascript and Java are different products developed by different companies. Javascript is the scripting language of Netscape, while Java is a new generation of object-oriented programming language developed by SUN Microsystems.
Second, the embedding methods 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.
Third, different types of languages:
JavaScript is a dynamically typed language, while Java is a statically typed language.
Fourth, the variables adopted 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. Different code formats
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 * .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.
6. 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.
7. Javascript does not operate on text and graphics directly. It plays a role 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.
After talking about so many differences between Java and JavaScrip, let's see if Java and JavaScript have anything in common.
Their syntax is similar to the C language; they are object-oriented (though implemented in a slightly different way); and JavaScript is designed with reference to Java's naming conventions.
Thank you for reading, the above is the content of "what is the difference between Java and JavaScript?" after the study of this article, I believe you have a deeper understanding of the difference between Java and JavaScript, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.