Comparison of Java and JavaScript (transfer)

*Netscape renamed Livescript to Javascript, which is an interesting variant of Java for client-side customization

*in Java

Perform detailed programming, while JavaScript is used for the client interface and overall integration of the system

*JavaScript: client interpreted, no compilation required

Java:

It needs to be compiled on the server side before executing on the client side

Note that both are fairly "pure" C/C++-like languages, without the useful sh/awk of Perl[5]

Text and system enhancements

*JavaScript: based on objects in Extensible Objects -- no classes or inheritance

Java: object-oriented. Programs are composed of object classes with inheritance relationships

*JavaScript: as embedded ascii text with HTML, but HTML often looks irrelevant!

Java: Applets

Significantly different from HTML, but is called from an HTML page

*JavaScript: do not specify the type of the variable – loosely typed

Java: summer to explain the type of a variable

– strong typing

*JavaScript - dynamic bundling - object references are computed at execution time

Java - static bundling - object reference must exist at compile time

*Java (applets) and JavaScript are reliable and cannot write to disk[@more@]

From "ITPUB Blog", link: http://blog.itpub.net/9650775/viewspace-922865/, if you need to reprint, please indicate the source, otherwise you will be held legally responsible.

Guess you like

Origin blog.csdn.net/m0_67390963/article/details/126728629