Basic HTML version of Foils prepared 3 March 99

Foil 13 Java vs. JavaScript II

From Overview of JavaScript I -- Basic Web Scripting Language CPS616 Technologies of the Information Age -- Spring Semester 99. by Geoffrey C. Fox (Tom Scavo)


Java classes and instances are distinct
A Java class has zero or more constructors
Java property inheritance follows class hierarchy
In Java, no way to add properties at run-time
JS object definition and constructor are identical and defined like methods
JavaScript property inheritance follows prototype chain
JavaScript properties may be added or removed at run-time
So essentially in JS, class structure is totally dynamic (a.k.a. Ill defined)



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Wed Mar 3 1999