Java and JavaScript are currently popular in more popular. Single from the surface, the names are similar, so many beginners are easy to confuse both, or they are directly classified. In fact, although they have close Contact, but it is indeed a completely different language. Next, the author only summarizes the main differences in their several.
One. Develop manufacturer
As we all know, Java is a programming language launched by Sun, which is especially suitable for Internet applications, and its predecessor is Oak language, and JavaScript is Netscape Company's products, which is an embedded web page developed to expand Netscape Navigator features. The explanatory language in the forehead is Live Script. Due to the popularity of Java, Netscape and Sun signed a contract to name JavaScript.
two. Object-oriented and object-based
Java is a true pure face-to-object programming language. Everything is object; JavaScript is a scripting language, because she itself provides a very rich internal object for programmer, so she is based on object-based language .
three. Different development and operational environments
If you want to write a program with Java and run, you must install the corresponding version of JDK and JVM in the system, and ensure that the code can get compiled and running; and write JavaScript is relatively simple, just use some HTML document editor Even a character editor (such as NotePad), then open the browser to run.
four. Variable difference
Using variables in Java must declare its data type before compiling, so she uses a strong type variable; JavaScript does not have to declare type before variable, but is automatically checked by the interpreter, so she is a weak type variable.
Fives. Different labels
Use the Applet applet written by Java to identify