foreach
来源:互联网 发布:怎么做手机淘宝 编辑:程序博客网 时间:2024/05/21 21:41
如果要使你的类能够使用 foreach方法,只要实现Iterable接口即可,Iterable接口包含一个能参数Iterator对象的iterator()方法
其实是for,java 没有foreach关键字
public class Test { publicstatic void main(String[] args) { int[]a = {1,2,3}; for(inti : a) System.out.print(i+ " "); } }
- foreach
- foreach
- foreach
- foreach
- Foreach
- forEach
- foreach
- foreach
- foreach
- forEach
- foreach
- foreach
- foreach
- foreach
- foreach
- foreach
- foreach
- foreach
- 有关操作系统安装,多系统安装,经…
- 在vs2010中使用qt的简单方法
- android+eclipse
- java 函数重载
- 泛型
- foreach
- try finally
- LONG RAW LOB CLOB BLOB BFILE
- char*argv[]
- c++控制台程序怎么隐藏
- 程序由debug改为release模式后
- opencv下运行模式的问题
- 暂停控制台3种方法
- 谷歌一面试题