Why is Integer written instead of int when using JavaBean to receive fields from the database? Why does the data layer return integer instead of int?

We will use Integer to receive the int type value from the database:

Insert image description here
Insert image description here
Reason: When we use Integer to receive data, we can receive null values, so that we can avoid null pointer errors.

Guess you like

Origin blog.csdn.net/qq_43374694/article/details/126054205