Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to convert an array into a string and how to program it?
How to convert an array into a string and how to program it?
1. In java, first of all, if the number is an integer, you can directly convert it with toString.

2. You can also display the numbers by converting them into binary, as shown in the figure below.

3. Similarly, if it is converted into octal display, you can directly add 8 to the toString parameter.

4. Of course, you can also convert the number into hexadecimal of 16, as shown in the figure below, which is similar to the above method.

5. Next, you can also fix the number of decimal places, as shown in the figure below. You can use toFixed to specify the number of decimal places displayed.

6. Finally, when the number is large, it can be displayed in the form of an index.