It can also be used to create standalone applications which are platform-independent. JavaScript statements are embedded in an HTML page and are interpreted at run time. The following table compares and contrasts JavaScript and Java. Compiled on server before execution on client. Code uses built-in, extensible objects, but no classes or inheritance.
Applets consist of object classes with inheritance.
Object references checked at run-time. Object references must exist at compile-time. Cannot automatically write to hard disk. Cannot automatically write to hard disk. JavaScript allows program scripts to be embedded in the Web document.