forked from processing/processing-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimplements.xml
More file actions
executable file
·73 lines (50 loc) · 1.46 KB
/
implements.xml
File metadata and controls
executable file
·73 lines (50 loc) · 1.46 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
65
66
67
68
69
70
71
72
73
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>implements</name>
<category>Structure</category>
<subcategory></subcategory>
<usage>Web & Application</usage>
<example>
<image></image>
<code><![CDATA[
interface Dot {
void move();
void display();
}
class CircleDot implements Dot {
float x = 50;
float y = 50;
void move() {
x = x + random(-1, 1);
}
void display() {
ellipse(x, y, 16, 16);
}
}
class SquareDot implements Dot {
float x = 50;
float y = 50;
void move() {
y = y + random(-1, 1);
}
void display() {
rect(x, y, 16, 16);
}
}
]]></code>
</example>
<description><![CDATA[
Implements an <i>interface</i> or group of <i>interfaces</i>. Interfaces are used to establish a protocol between classes; they establish the form for a class (method names, return types, etc.) but no implementation. After implementation, an interface can be used and extended like any other class.<br />
<br />
Because Java doesn't allow extending more than one class at a time, you can create interfaces instead, so specific methods and fields can be found in the class which implements it. A Thread is an example; it implements the "Runnable" interface, which means the class has a method called "public void run()" inside it.
]]></description>
<syntax></syntax>
<returns></returns>
<related>
extends
</related>
<availability>1.0</availability>
<type>Keyword</type>
<partof>PDE</partof>
<level>extended</level>
</root>