Int is one of the eight primitive data types provided by Java. Java provides encapsulation classes for each original type, and integer is the Java-based int
Encapsulation class. The default value of int is 0, while the default value of integer is null. That is, integer can differentiate unassigned values from 0,
Int indicates that no value is assigned. For example, if you want to express the difference between not taking the test and 0, you can only use integer.
In JSP development, the default integer value is null. Therefore, when an El expression is used to display it in a text box, the value is a blank string, whereas int is the default value.
The default value is 0, so the result is 0 when the El expression is displayed in the text box. Therefore, int is not suitable for form data of the web layer.
Type.
In hibernate, if the oId is defined as an integer type, Hibernate can judge a type based on whether its value is null.
Objects are temporary. If the oId is defined as the int type, you also need to set its unsaved-value attribute in the HBM ing file.
0.
In addition, integer provides multiple integer-related operation methods. For example, to convert a string to an integer, integer also defines
A constant that represents the maximum and minimum values of an integer.