Relationship and the distinction between Java with JavaScript

A recent study in both languages, brought to share with you

Presumably a lot of people new to Java and know when the curious relationship between it and JavaScript, so looks like, is it an upgrade from the same door? Ah, they are really quite the inventor of origin, but objectively speaking, JS indeed compared with Java more concise public, but they are essentially still are two completely different languages, and that the difference between what it?

 

Different data types

Java data types are divided into eight kinds, namely: byte, short, int, long , float, double, char and Boolean, and JavaScript data into three types, namely: number, string and Boolean.

In addition, Java and Javascript variable is also different.

 

Two different positioning

Java is a fully object-oriented programming language and want to use Java to write something you have to design objects, and JavaScript is not the same, it is a scripting language based on an object, it comes with a lot of internal object is to provide developers, to save time is more simple.

 

Different ways Binder

Java uses static binding, Java object reference must be on at compile time, the compiler needs to achieve strong type checking, and different JavaScript, which uses dynamic binding, its object references can be checked at runtime.

 

Use different

They use the most essential difference is that, Java is widely used in the PC side, the phone side, the Internet, data centers, etc., and were mainly used JavaScript embedded text to HTML pages, read and write HTML elements, control cookies and so on.

Java and JavaScript each have their own strengths specialization, Java programming stage in the field, and was at the heart of JavaScript in the Web page, it is almost omnipotent.

Reprinted from: https: //www.cnblogs.com/chinasitu/p/7245203.html

Guess you like

Origin www.cnblogs.com/blg2/p/11936449.html