when converting int to binary, how to output it to 8 character, currently it only display 1 and short of the 7 zeros
code
int x = 1;
String bin = Integer.toBinaryString(x);
System.Out.Println(bin);
example output to 0000 0001
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…