Why do I need a wrapper class?
Java is supported across platforms. Can be run on the server or on the phone
Basic data types are more efficient in stacks
Wrapper classes convert data types to objects in the heap to facilitate operations
1 Package Cn.bjsxt.wrapperclass;2 /**3 * Wrapperclass Packaging class4 * Packaging class Location Lang package does not need to import5 * 6 * @author Administrator7 *8 */9 Public classTest01 {Ten Public Static voidMain (string[] args) { One //turn 1000 into an object AInteger i =NewInteger ( +); - //the maximum value of an integer -System. out. println (integer.max_value); the //In 16 binary notation -System. out. println (integer.tohexstring (i)); - //converts a string to an integer assignment to I2 -Integer i2 = Integer.parseint ("123"); +System. out. println (I2); - //+10 +System. out. println (i2+Ten); AInteger i3 =NewInteger ("233"); atSystem. out. println (i3); -Integer I4 = Integer.parseint (" -"); -System. out. println (i4); - //number becomes string concatenation directly -String str = the+""; -System. out. println (str); in } -}
Common class one by one basic data type wrapper class (Wrapperclass) one by one byte short Nteger Long Float Double Character Boolean