gogoWebsite

Java basic data type to string

Updated to 2 days ago

There are four ways to convert Java basic data types to strings

1.Captive type conversion

String str=(String)num

2. Through the form of empty string + number

String str=""+num

3. Use the static method valueOf of the String class

String str=(num)

4. First box the basic type into an object, and then call the object's toString method (this method is more troublesome, and the above three methods are recommended)

About unpacking and checkinghere