Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

The Science of Programming/SwayPresentations/Objects/VariationInheritance

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Variation Inheritance Variation inheritance: whereby the subclass changes a behavior of the super class. function super() { var greeting = "hello"; function a() { greeting; } this; } function sub() { function a() { "well, " + a . prior() + " there!"; } extends(super()); } var s = sub(); println(s . a()); The output is: well, hello there! Looking at the s object gives: <OBJECT 2611>: context: <OBJECT 654> dynamicContext: <OBJECT 654> callDepth: 1 constructor: <function sub()> this: <OBJECT 2611> a: <function a()> a: <function a()> greeting: "hello" Next Previous Top