2
I would like to create a variable for each iteration of a for. Example:
for(u=0;u<tamanho;u++)
{
int variavel[u] = "valor"
}
It is possible?
UPDATE
This is the real code.
SearchConstraint c1 = factory.createConstraint("metadata#version", f1, f1, ConstraintType.MUST);
SearchConstraint c2 = factory.createConstraint("regiao_codigo", "1", "1", ConstraintType.MUST);
SearchConstraint[] constraints = new SearchConstraint[2];
constraints[0] = c1;
constraints[1] = c2;
dataset = factory.getDataset("ibv", null, constraints, null);
Note that it has two variables C1 and C2. I need to create them dynamically.
I need to create "u" number of variables with each for iteration. It can’t be vector, I have to create distinct variables. The code is just an example.
– durtto
If you’re placing C1 and C2 inside a vector at the end of the accounts, why can’t you use that vector to create them in your iteration ?
– RafaelTSCS
You know you can create a vector using a variable as size, right?
new SearchConstraint[u]
– mgibsonbr
Is Searchconstraint a Java type? I think this Searchconstraint is the tool I use.
– durtto
Searchconstraint is either Fluig or is ECM 3.0
– Emir Marques
gives yes @mgibsonbr, I got.
– durtto
@Rafaeltscs that simple information of yours cleared my mind. I did. Turn it into an answer for me to accept it.
– durtto