plus()
附加一个字符串
语法 (Syntax)
String plus(Object value)
参数 (Parameters)
Value - 要附加到字符串的对象
返回值 (Return Value)
此方法返回结果String。
例子 (Example)
以下是此方法的使用示例 -
class Example {
static void main(String[] args) {
String a = "Hello";
println(a.plus("World"));
println(a.plus("World Again"));
}
}
当我们运行上述程序时,我们将得到以下结果 -
HelloWorld
HelloWorld Again