JAVA中如何每隔一段时间就把函数的返回值作为参数重新传入该函数进行下一次运算

public class Test{
static int a=0;
public static void mian(String[] args){
add(1);
}
public static void add(int b){
a +=b;
System.out.println(a);
try{
Thread.sleep(1000);
}catch(InterruptedException e){
e.printStackTrace()
}
add(a);
}
}

举个例子,你就会明白了。
如,你输入的一行:abc cde efg
注意,其中abc和cde之间有空格,cde和efg之间也有空格
这样,next()返回的是abc,
而nexLine()返回的是整行:abc cde efg