我是 php 开发人员,刚开始使用 java 我想在循环内声明动态变量,为此我必须将循环值附加到可变名称,这就是我想要的。
I would like to make statement like this
for (i=1; i<6; i++)
{
String new_variable_ + i;
}
上面的代码在java中不工作怎么办呢?
最佳答案
what you are trying to do is not possible in java ... this language is not that lose like php..its a type strict language
关于java - 名称包含来自循环的值的变量声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11372432/