8.2 命令行参数示例(实验)
public class Test {
public static void main(String[] args){
if(args.length==0){
System.out.println("you don't set command line parameters!");
}else{
for (int i=0; i<args.length; i++){
System.out.println("args[" + i + "] is: " + args[i]);
}
}
}
}
when use eclipse, don't "run as application",directly use "run configurations/run", then add in aguments in program arguments.(当运行eclipse,不要"run as application",而直接用"run configurations/run",然后加上参数在,program arguments.)
result is:
args[0] is: 马克-to-win
args[1] is: 的
args[2] is: 书
下图是有关非eclipse命令行的实验:
8.3 Arrays of Arrays(1)
An array that contains other arrays as its elements.(一个数组中包含其他的数组作为它的元素)
public class TwoDimentional {
public static void main(String[] args) {
char[][] table= new char[2][4];
char[] row0 = {'A','B','Z','M'};
char[] row1 = {'C','D','K','L'};
table[0] = row0;
table[1] = row1;
for(int i=0; i<2;i++){
for(int j=0;j<4;j++){
System.out.println(table[i][j]);
}
}
}
}
更多请看:https://blog.csdn.net/qq_44639795/article/details/103144589
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有