此方法由++运算符为String类调用。它增加给定字符串中的最后一个字符。
句法
- String next()
参数
没有
返回值
字符串的新值
例子
下面是一个使用这个方法的例子 -
- class Example {
- static void main(String[] args) {
- String a = "Hello World";
- println(a.next());
- }
- }
当我们运行上面的程序,我们将得到以下结果 -
- Hello Worle
转载本站内容时,请务必注明来自W3xue,违者必究。