java using a digital type Notes

1 in the java if required calculations more accurate data will be used BigDecimal class. BigDecimal class in the new parameters may be used, or int class String class, do not use the float or double float constant or a parameter directly;

2 If using cyclic addition calculation, etc., do not use Integer, Long and other objects packing, because boxing and unboxing can cause unintended behavior;

3 When comparing Integer, Long and other packing objects, use equal method instead of '=='; (virtual cache for the opportunity to do Integer, Long object is some small value, use '==' to be true, but when the value when greater than a certain value '==' will provide false);

4 has been given in the class attribute is an int, when the front and rear sets of page data is transmitted, this attribute may occur where the default value 0;

Guess you like

Origin www.cnblogs.com/zhang-feng/p/11888295.html