当前位置:网站首页>利用foreach循环二维数组
利用foreach循环二维数组
2022-06-26 09:37:00 【m0_61961898】
for (循环变量 x : 遍历对象 obj) {
引用了x的Java语句
} //不必对x进行初始化
结果
public static void main(String[] args) {
int u[][]= new int [][] {
{4,5,6},{8,1},{9,2,7,3}};
for ( int x[] : u) {
for (int y : x) {
System.out.print(y + "\t");
}
System.out.println();
}
}
}结果

边栏推荐
- 118. Yanghui triangle
- Does the go compiled executable have dynamic library links?
- 国际化配置
- Internationalization configuration
- LeetCode 498. Diagonal traversal
- 如何更改微信小程序二维码物料颜色
- 美国总统签署社区安全法案以应对枪支问题
- SSM项目小例子,SSM整合图文详细教程
- Automated testing -- on the coexistence of Unitest and pytest initialization
- Force buckle ----- remove the maximum and minimum values from the array
猜你喜欢

Detailed explanation of winsorflow quantum installation process

This new change of go 1.16 needs to be adapted: the changes of go get and go install

Redis master-slave replication in win10 system

What should the preview do?

Constraintlayout control uses full Raiders

Deep learning (tentsorflow2. version) three good student performance problems (1)

【LeetCode】59. Spiral matrix II

Test instructions - common interface protocol analysis

Redis notes (15) - Pipeline (the client packages and sends batch commands to save network overhead)

mysql学习总结
随机推荐
1. 两数之和(LeetCode题目)
方法区里面有什么——class文件、class文件常量池、运行时常量池
全渠道、多场景、跨平台,App如何借助数据分析渠道流量
Why do some functions in the go standard library have only signatures but no function bodies?
【深度优先搜索】312.戳气球
Automated testing -- Introduction and example of pytest framework
LeetCode 0710. Random numbers in the blacklist - preprocessing implementation o (1) value
Openxcap usage
1. sum of two numbers (leetcode topic)
Force buckle ----- remove the maximum and minimum values from the array
Luogu 1146 coin flip
从tf 1.x到tf 2.6(遇到的就过来更新更新)
The basis of C language grammar -- function nesting, Fibonacci sum of recursive applet and factorial
Custom interceptor
Redis master-slave replication in win10 system
Poj3682 king arthur's birthday celebration (probability)
Basic string operations in C
【LeetCode】59. Spiral matrix II
【无标题】
The first batch of 12 enterprises settled in! Opening of the first time-honored product counter in Guangzhou