Næste
Forrige
Oversigt
Workshop i JavaScript serie, Planche nr. 11
Kursus Indhold

JavaScript er IKKE Java

Forskellen mellem JavaScript og Java (ifølge Netscape)

Table 1.1  JavaScript compared to Java
JavaScript Java

Interpreted (not compiled) by client.

Compiled bytecodes downloaded from server, executed on client.

Object-oriented. No distinction between types of objects. Inheritance is through the prototype mechanism, and properties and methods can be added to any object dynamically.

Class-based. Objects are divided into classes and instances with all inheritance through the class hierarchy. Classes and instances cannot have properties or methods added dynamically.

Code integrated with, and embedded in, HTML.

Applets distinct from HTML (accessed from HTML pages).

Variable data types not declared (dynamic typing).

Variable data types must be declared (static typing).

Cannot automatically write to hard disk.

Cannot automatically write to hard disk.


© 1999 BLA*net - Leif E. Andersen, leander@blanet.dk