Java array output
For a 01 string with a length of 5 bits, each bit may be 0 or 1, and there are 32 possibilities in total. The first few of them are:
00000
00001
00010
00011
00100
Please output the 32 kinds of 01 strings in ascending order.
public class Demo8 {
public static void main(String[] args) {
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
for (int m = 0; m < 2; m++) {
for (int n = 0; n < 2; n++) {
for (int v = 0; v < 2; v++) {
System.out.println(i+" "+j+" "+m+" "+n+" "+v);
}
}
}
}
}
}
}