0
need to generate several nested structures (26) wanted to know how to do this with methods pro code not get too big an example of the structure I need with 4 nested:
public static void main(String[] args) {
String[] vet={"1","2","3","4"};
for(int i=0;i<4;i++)
for(int j=0;j<4;j++) if(i!=j)
for(int k=0;k<4;k++) if(j!=k && i!=k)
for(int l=0;l<4;l++) if(k!=l && i!=l && j!=l)
System.out.println(vet[i]+vet[j]+vet[k]+vet[l]);
}
Out of curiosity, what is your need to need 26
for
nested?– StatelessDev
I would also like to know what makes it necessary to have 26 ties, surely there must be better ways to do this.
– user28595
Just to reinforce what has already been said 26 nested structures is no solution to any problem. Rethink the problem, and follow a viable path, other than this.
– Isac