为for循环每次创建值 [英] Create values for each time the for loop loops
本文介绍了为for循环每次创建值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
类似于这样:
$ p $
for(int i = 0; i Vector max [i] = new Vector(i + 1,i + 2,i + 3);
我对java很陌生,所以我不明白很好。
感谢您的帮助。
解决方案
Vector [] max = new Vector [con.length]; (int i = 0; i max [i] = new Vector(i + 1,i + 2,i + 3)的
。
}
So I'm trying to create a for loops that creates a new value each times it runs. Something like this:
for(int i = 0; i < con.length; i++) {
Vector max[i] = new Vector(i+1, i+2, i+3);
}
I'm kind of new to java, so i don't understand it very well. Thanks for your help.
解决方案
This should work
Vector[] max = new Vector[con.length];
for(int i = 0; i < con.length; i++) {
max[i] = new Vector(i+1, i+2, i+3);
}
这篇关于为for循环每次创建值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文