Web design and Java differences JS

Create a Web Page in a variety of forums, people often ask what is the difference between Java and javascript, and even some people mistakenly believe that Java.javascript javascript and Java does have some connection, but they are not as closely as we thought, even say with certainty that they are very different.
What is JavaScript?
JavaScript is an implementation of ECMA 262 language specification. the purpose of this tutorial is to guide you through the use of JavaScript, are all examples of Internet Explorer 5 under through, I did not in each version of the Netscape browser in the test, it may not run smoothly in some examples of Netscape's browser.
easy to use
JavaScript is an interpreted, object-based scripting language. Although such a mature C ++ and Java the object-oriented language in comparison, JavaScript function to be weaker, but for its intended use, JavaScript functions have been big enough.
JavaScript is not any Lite in other languages (eg, Java and it's just a little vague and indirect relations), nor any simplify things, but it has its limitations. For example, You can not use that language to write applications that run independently and function of the language reading and writing files is very small. In addition, JavaScript script can only run on a interpreter, the interpreter can be a Web server, it can be Web browser.
JavaScript is a loosely typed language. this means you do not have to explicitly define the data types of variables. in addition, in most cases, JavaScript will be converted automatically as needed. For example, if you try to add a value to an item (a string) are composed of text, and the value will be converted to text.
What is JAVA?
Sun introduced Java is a programming language. It is a language performed by way of explanation, similar to the grammar rules and C ++. At the same time, Java is a cross-platform programming language. Programs written in the Java language called " Applet "(small applications), the compiler will use it compiled into class files, it exists WWW page, and make the marks on the HTML file, as long as the client Java client software installed on it directly online run "Applet". Java is ideal for corporate networks and Internet environment, has now become the most popular Internet, one of the most influential programming language. Java has many laudable advantages, such as simple, object-oriented, distributed, explanatory, reliable, secure, architecture
neutral, portable, high-performance, multi-threaded, dynamic and so .Java abandoned more harm than good C ++ in various functions and many rarely used functions. Jave can run with any microprocessor, Java application development can be transmitted over a network and run on any client.
difference between javascript and Java are mainly in the following aspects:
a, javascript and Java are different The company developed different products .javascript is Netscape's products, its purpose is to extend Netscape Navigator function, and a development can be embedded in an interpreted language object-based and event-driven Web pages; and SUN Microsystems Java is launched a new generation of object-oriented programming language, particularly suitable for Internet application development. in fact, javascript original name is not javascript, but LiveScript, in the name of "Java" is the result of SUN Microsystems authorized.
Two, javascript is object-based, it is a scripting language, is an object-based and event-driven programming language, which itself provides a very rich internal object for designers to use. And Java is an object-oriented, that is, Java is a true object-oriented language, even the development of simple procedures must also design objects.
three, javascript and Java embedded in a different way. in the HTML document, identify two programming languages are different, javascript to use to identify hh , and to identify the use of Java.
Fourth, the way javascript and Java in the browser is not performed as .javascript is an interpreted programming language, its source code is sent to the client prior to execution without compiled, but will character code text format sent to the customer, that javascript statement itself with the Web page to download down together, interpreted by the browser execution. the Java source code delivered to the client before the execution, must be built, so the client must have the appropriate emulator or interpreter on the platform, which can be achieved by a compiler or interpreter platform independent of a specific compiled code.
five, javascrip t and Java code format is not the same .javascript code is an occasion to seek Tsui disaster site lined sword tip benzene fear of TML document, and can be dynamically loaded, writing HTML documents as easy as editing text files, format independent files * .js.Java as an independent format of HTML, it must be loaded via the reference in the outer media like HTML, the code stored in byte code form in a separate document, the format of which is independent of file *. class.
VI javascript variable is taken with Java variable declaration is not the same with a weak .javascript type, i.e., no need to make the variable declaration before use, but the interpreter checks its data type at run time using a strong .Java type variable checking that all variables before compiling must make a statement.
Seven, javascript using dynamic binding, namely javascript object references at runtime checks .Java using static binding, the Java object reference must be carried out at compile time, so that the compiler can achieve strong type checking.
Eight, javascript not directly on the text and graphics operation, it plays in the Web page HTML elements combined together with the role, but it can control the browser so that the browser directly to the text and graphics processing. Java is possible for text and graphics directly operation.
in summary, we can find, javascript and Java although can be applied to web design, but they do have much difference, is simply two languages.

Reproduced in: https: //www.cnblogs.com/521taobao/archive/2012/03/17/2402421.html

Guess you like

Origin blog.csdn.net/weixin_34377065/article/details/93355868