Files
processing4/mobile/web/reference/API/addition.xml
2005-01-27 06:48:42 +00:00

81 lines
1.4 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>+ (addition)</name>
<category>Math</category>
<subcategory>Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int a = 50 + 5; // Sets a to 55
int b = a + 5; // Sets b to 60
</code>
</example>
<example>
<image></image>
<code>
String s1 = "Chernenko";
String s2 = "Brezhnev";
String sc1 = s1 + s2;
String sc2 = s1 + ", Andropov, " + s2;
println(sc1); // Prints ChernenkoBrezhnev
println(sc2); // Prints Chernenko, Andropov, Brezhnev
</code>
</example>
<example>
<image></image>
<code>
String s1 = "Gorbachev";
int i = 1987;
String sc1 = s1 + i;
println(sc1); // Prints Gorbachev1987
</code>
</example>
<description>
Adds two values or concatenates string values. As a mathematical operator, it calculates the sum of two values. As a string operator, it combines two strings into one and converts from primitive datatypes into the String datatype if necessary.
</description>
<syntax>
<c>value1</c> + <c>value2</c>
</syntax>
<parameter>
<label>value1</label>
<description>String, int, float, char, byte, boolean</description>
</parameter>
<parameter>
<label>value2</label>
<description>String, int, float, char, byte, boolean</description>
</parameter>
<returns></returns>
<related>
++ (increment)
+= (add assign)
- (minus)
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>