!!! Listing 1 function Shape (centerX, centerY, color) { // Eigenschaften this.centerX = centerX; this.centerY = centerY; this.color = color; // Methoden this.move = moveShape; } !!! Listing 2 /* Vererbung in Java */ public class Circle extends Shape { public int diameter; public Circle (centerX, centerY, color, diameter) { super (centerX, centerY, color); this.diameter = diameter; } } /* Vererbung in JavaScript */ function Circle (centerX, centerY, color, diameter) { this.diameter = diameter; this.centerX = centerX; this.centerY = centerY; } Circle.prototype = new Shape (); !!! Listing 3 function instanceOf (obj, proto) { if (document.all) return (eval ("obj instanceof proto")); while (obj != null) if (obj == proto.prototype) return true; else obj = obj.__proto__; return false; } !!! Listing 4