In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-25 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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.