天天看点

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

继续阅读