如何找到数组列表的长度? [英] How to find the length of an array list?

查看:20
本文介绍了如何找到数组列表的长度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何找到数组列表的长度.我认为您可能需要使用 blank.length(); 但我不确定.

I don't know how to find the length of an array list. I think you might need to use blank.length(); but I'm not sure.

我做了一个数组列表

ArrayList<String> myList = new ArrayList<String>();

但是我如何编写代码来打印出 myList 的大小?

but how do I write code to print out the size of myList?

推荐答案

size 成员函数.

myList.size();

http://docs.oracle.com/javase/6/docs/api/java/util/ArrayList.html

这篇关于如何找到数组列表的长度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆