JN0025-Starting -- Groovy 之 ABC
Groovy 字符串可以是如下形式:
def i=0, j=0def f= new File('TheOutput.txt') //create or overwrite this fileThread.start{ while(true){ i++ if(i%1000 == 0) f<< 'S' //spawned thread }}while(true){ j++ if(j%1000 == 0) f<< 'M' //main thread}