Be careful when designing database fields or using boolean type in Java
•
Java
Boolean variables have only two values: false and true. We will use Boolean when designing database fields or defining Java variables. Generally, it is indisputable to use variables of switch class, but we must consider scalability.
Please consider carefully before using: it may not be possible to expand this field or variable in the future. Considering possible expansion, it is recommended to use int instead.
The above is a little gain from my recent refactoring of previous code.
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码