package com.testenhanced;
import java.util.* ;
import java.util.Collection;
public class TestEnhanced {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] arr = {1,2,3,4,5,6} ;
for(int i: arr) {
System.out.println(i) ;
}
Collection c = new ArrayList() ;
c.add(new String ("asd")) ;
c.add(new String ("lmn")) ;
c.add(new String("156")) ;
for(Object o: c) {
System.out.println(o) ;
}
}
}
console:
1
2
3
4
5
6
asd
lmn
156
//
除了简单遍历并读出其中的内容外,不建议使用增强for
分享到:
相关推荐
用于解决Atom本地安装markdown-preview-enhanced插件时出现的找不到"@shd101wyy"等文件夹的问题,使用时确认"markdown-preview-enhanced"文件夹在".atom\packages" 文件夹下,将此压缩文件解压后的"node_modules...
mation, yielding great values for both users and service providers. However, this problem is perceptibly complex because various data trends need to be considered together. This includes the spatial ...
在Java编程语言中,JDK 5引入了一个重要的特性,即增强for循环(也称为foreach循环),这大大简化了对集合和数组的迭代操作。在本文中,我们将深入探讨这个特性,了解其工作原理,以及如何在实际开发中有效地利用它...
SEMI E84-0301规范是针对半导体制造行业自动运输系统的一种通讯标准。该标准是由设备自动化协会制定,旨在提高半导体工厂中材料搬运系统的自动化程度。随着半导体晶圆尺寸的增大,未来半导体工厂将广泛使用自动物料...
这篇文章主要讨论了一种改进的k均值聚类算法(Enhanced k-Means Clustering Algorithm),该算法用于对疟疾图像进行像素级别的无监督分割。疟疾是一种由寄生虫疟原虫引起的疾病,其诊断常常依赖于对血液涂片的显微镜...
### Enhanced Host Controller Interface (EHCI) Specification for Universal Serial Bus (USB) #### Introduction The Enhanced Host Controller Interface (EHCI) specification is designed for the Universal...
【船级社】 ABS Guide for Enhanced Fire Protection Arrangements 2021
在《A Rationale for Semantically Enhanced Library Languages》这篇论文中,作者Bjarne Stroustrup,也就是C++语言的设计者,提出了一个创新的理念,即通过库语言的语义增强(Semantically Enhanced Library ...
This document defines the low speed electrical and management interface specifications for enhanced Small Form Factor Pluggable(SFP+) modules and hosts. The SFP+ module is a hot pluggable small ...
-This is a Matlab implementation for the forwards additive version of ECC image alignment algorithm based on the paper "G.D. Evangelidis, E.Z. Psarakis, Parametric Image Alignment using Enhanced ...
知识增强的预训练模型(KEPTMs)是近年来自然语言处理领域的重要研究方向,它们旨在克服传统预训练模型的局限性,如模型的鲁棒性不足和解释性差。预训练模型通过自我监督学习在大规模文本语料库上学习到上下文相关的...
Also includes an Enhanced TemplateField to enable the FilterTemplate, as well as an Enhanced CommandField to allow for a filter button, resolve image button double postbacks, and enable some of the ...
本论文《FedBABU:面向联邦图像分类的增强表示法》(FedBABU: Towards Enhanced Representation for Federated Image Classification)深入研究了全局模型与个性化模型之间的关系。作者首先通过分析联邦平均算法...
因此,美国船级社ABS发布了一份关于船舶轴向精准对准的详细指南,即ABS Guide for Enhanced Shaft Alignment 2022-07。这份指南提供了船舶轴向对准的全面分析与安装评估方法,特别适用于轴向对准敏感型船舶,意在...
EDSR-Enhanced Deep Residual Networks for Single Image Super-Resolution论文代码,NTIRE2017冠军,Torch写的,欢迎各位下载