Java and JavaScript are two different programming languages. Java was the most popular programming language at the time, and the name "Java" helped spread the word, so Netscape named LiveScript JavaScript; in short, it was a hot topic, which greatly helped its development.
The operating environment of this tutorial: windows7 system, javascript1.8.5&&java8 version, Dell G3 computer.
Java and JavaScript are two different programming languages.
It is generally believed that the reason why Netscape named LiveScript JavaScript at that time was because Java was the most popular programming language at the time, and the name with "Java" helped the spread of this new language.
To put it bluntly, isn't this a typical hot spot nowadays?
Many Java programmers want to learn a scripting language. When they see how it is so similar to Java, they feel very familiar with it, so they might as well learn it.
JavaScrip has taken advantage of Java's hot spots, which has greatly helped its development. Of course, its language itself is also excellent, and it has slowly been recognized by the public.
The similarities between Java and JavaScript include:
Their syntax is very similar to the C language;
They are all object-oriented (although the implementation methods are slightly different);
JavaScript is designed with reference to Java’s naming rules;
The differences between Java and JavaScript include:
JavaScript is a dynamically typed language, while Java is a statically typed language Language;
JavaScript is weakly typed, and Java is strongly typed;
JavaScript’s object-oriented approach is prototype-based Implemented, Java is class-based;
In addition to looking similar to Java, JavaScript has a very different language style. JavaScript was designed with reference not to Java, but to languages like Self and Scheme.
[Recommended learning: javascript advanced tutorial]
The above is the detailed content of What is the relationship between java and javascript?. For more information, please follow other related articles on the PHP Chinese website!