String, decimal number, binary number conversion

1. Convert numbers to strings
int n=10;
String s=String.valueOf(n);
2. Convert strings to numbers
String s="10";
int n1=Integer.parseInt(s);
3. Convert decimal numbers binary
int n = 2;
String s = Integer.toBinaryString(n);

Guess you like

Origin blog.csdn.net/qq_44114147/article/details/124962891