-
-
Notifications
You must be signed in to change notification settings - Fork 173
Expand file tree
/
Copy pathextends.xml
More file actions
executable file
·64 lines (46 loc) · 1.2 KB
/
Copy pathextends.xml
File metadata and controls
executable file
·64 lines (46 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>extends</name>
<category>Structure</category>
<subcategory></subcategory>
<usage>Web & Application</usage>
<example>
<image></image>
<code><![CDATA[
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);
}
}
]]></code>
</example>
<description><![CDATA[
Allows a new class to <em>inherit</em> the methods and data fields (variables and constants) from an existing class. In code, state the name of the new class, followed by the keyword <b>extends</b> and the name of the <i>base class</i>. The concept of inheritance is one of the fundamental principles of object oriented programming.<br />
<br />
Note that in Java, and therefore also Processing, you cannot extend a class more than once. Instead, see <b>implements</b>.
]]></description>
<syntax></syntax>
<returns></returns>
<related>
class
super
implements
</related>
<availability>1.0</availability>
<type>Keyword</type>
<partof>PDE</partof>
</root>