plus
Adds the other integer to this one.
Calling from Kotlin
Here's an example of calling this function from Kotlin code:
val x: Integer = Integer.parse("99999999999999999999")
val y: Integer = Integer.parse("1")
val result: Integer = x + y
val expected: Integer = Integer.parse("100000000000000000000")
check(result == expected)Content copied to clipboard
Calling from Java
Here's an example of calling this function from Java code:
final Integer x = Integer.parse("99999999999999999999");
final Integer y = Integer.parse("1");
final Integer result = x.plus(y);
final Integer expected = Integer.parse("100000000000000000000");
final boolean check = result.equals(expected);
if (!check) throw new IllegalStateException("Check failed.");Content copied to clipboard