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 java and javascript

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 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".

Differences: 1, javascript is developed by Netscape, java is developed by SUN; 2, JS is identified by script tag, while Java is identified by Applet; 3, JS is a dynamic type, Java is a static type; 4, JS variables use weak types, Java uses strong types, and so on.

The operating environment of this tutorial: windows7 system, javascript1.8.5 version, Dell G3 computer.

What is the difference between Java and JavaScript? it is said that there are still many people who don't know. Let's popularize the science for everyone.

The differences between Java and JavaScript:

1. The use is different:

The most essential difference between them is their purpose: Java is widely used in PC, mobile, Internet, data center and so on.

JavaScript is widely used in Web application development to add a variety of dynamic functions to web pages and provide users with a more smooth and beautiful browsing effect.

2. Different origins:

Javascript and Java are different products developed by different companies. Javascript is the scripting language of Netscape.

Java is a new generation of object-oriented programming language developed by SUN (full name SUN Microsystems).

3. Different embedding methods:

In HTML documents, the identity of the two programming languages is different, which is used by Javascript, while Java is identified by Applet.

4. Different language types:

JavaScript is a dynamically typed language; Java is a statically typed language.

5. 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.

6. The code format is different:

Javascript code is dynamic, can be directly embedded in HTML documents, and can be dynamically loaded, 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.

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.

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.

What Java and JavaScript have in common:

Their syntax and C language are very similar; they are both object-oriented (though implemented slightly differently); JavaScript is designed with reference to Java's naming conventions; all in all, JavaScript is very different in language style except that it looks like Java. The objects that JavaScript refers to at design time do not include Java, but include languages such as Self and Scheme.

Java and JavaScript have their own strengths and specialties. The stage of Java is in the field of programming, while the advantage of JavaScript is that it is almost omnipotent in the Web page.

Thank you for your 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.

Share To

Development

Wechat

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

12
Report