Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - When to use int and integer for java problems
When to use int and integer for java problems
Int is the basic data type.

Integer is an object type. When you want to load containers like Vector ArrayList, you need to load them as objects. See api for details. The parameters in the method descriptions of some classes are object types. If you want to pass in an integer, you can only use it as an integer. The api also has a detailed description of this class.

The Integer class wraps the value of the basic type int in an object. An object of type Integer contains a field of type int.

In addition, this class provides several methods to convert between int type and String type, and also provides some other constants and methods, which are very useful when dealing with int type.