天天看點

BeanShell腳本方法

<b>BeanShell </b>

int addTwoNumbers( int a, int b ) { 

return a + b; 

sum = addTwoNumbers( 5, 7 ); // 12 

運作效果:

<b>的方法也允許動态的(弱類型)參數和傳回值類型。</b>

add( a, b ) { 

foo = add(1, 2); // 3 

foo = add("Oh", " baby"); // "Oh baby" 

本文轉自 tongqiuyan  51CTO部落格,原文連結:http://blog.51cto.com/tongqiuyan/743231

繼續閱讀