FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
      Language \ Environment \ Libraries \ Comparison
 
   
   
Abridged (A-Z) \ Complete (A-Z)  
   
  Reference for Processing (BETA) version 91+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.  
Name  

extends

   
Examples  
DrawDot dd1 = new DrawDot(50, 80); 
 
void setup() { 
  size(200, 200); 
} 
 
void draw() { 
  dd1.display(); 
} 
 
class Dot { 
  int xpos, ypos; 
} 
 
class DrawDot extends Dot { 
  DrawDot(int x, int y) { 
    xpos = x; 
    ypos = y; 
  } 
  void display() { 
    ellipse(xpos, ypos, 200, 200); 
  } 
} 
 

Description   Allows a new class to inherit the methods and fields (data members) from an existing class. In code, state the name of the new class, followed by the keyword extends and the name of the base class. The concept of inheritance is one of the fundamental principles of object oriented programming.
   
Syntax  
extends
   
Usage   Web & Application
   
 
 






   
 
Updated: Fri Jul 15 16:35:38 PDT 2005
 
 








Creative Commons License
 
  Processing is an open project initiated by Ben Fry and Casey Reas  
  © Info