W3Cschool
恭喜您成为首批注册用户
获得88经验值奖励
返回此范围中的元素数。
int size()
没有
返回范围的大小。
下面是一个使用这个方法的例子 -
class Example {
static void main(String[] args) {
// Example of an Integer using def
def rint = 1..10;
println(rint.size());
}
}
当我们运行上面的程序,我们将得到以下结果 -
10
Copyright©2021 w3cschool编程狮|闽ICP备15016281号-3|闽公网安备35020302033924号
违法和不良信息举报电话:173-0602-2364|举报邮箱:jubao@eeedong.com

扫描二维码
下载编程狮App

编程狮公众号
联系方式:

更多建议: