Java is an object-oriented language where classes in Java Connect methods to data and form self-contained processing units. However, you cannot define the base type (primitive type) in Java, and you can connect the related methods to treat the base type as an object. Java provides wrapper classes for each of the basic types so that we can convert these basic types to objects. These packaging categories are: Boolean,byte,short,character,integer,long,float,void and so on.
It is worth noting that Java can handle basic types directly, but in some cases we need to treat them as objects, and then we need to convert them into wrapper classes. All packaging classes (wrapper class) have a common approach, they are:
(1) A constructor that has a basic value parameter and creates a wrapper class object. If you can use the integer wrapper class to create the object, the integer obj=new integer (145);
(2) A constructor that has a string parameter and creates a wrapper class object. such as new Integer ("-45.36");
(3) A toString () method that generates a string representation, such as obj.tostring ().
(4) The Equals () method for comparing two objects of the same class, such as Obj1.eauqls (OBJ2);
(5) The Hashcode method of generating the HA dilute table code, such as Obj.hascode ();
(6) A Parsetype method that converts a string to a basic value, such as Integer.parseint (Args[0));
(7) A Typevalue method for generating the basic value of an object, such as Obj.intvalue ();
In certain occasions, the use of Java packaging classes to solve problems, can greatly improve the programming efficiency.