Recently, I wrote a recursive method. During the comparison and determination, the integer type is integer, And the integer type is created when it is greater than 127 or less than-128, this is because of the integer-type disassembly box mechanism,
The efficiency of the equals and = methods has not been considered before. To avoid errors caused by integer box disassembly mechanism, the integer type is used as string. valueof () method, convert all integer types to strings and use the equals Method for comparison.
Later I was inadvertently seen by my master and pointed out this error. I immediately changed it to integer. intvalue () converts the integet type to the int type. After testing, the total data volume is 624 records, saving 32 milliseconds. It turns out that the total data volume is 44 milliseconds and the total data volume is 12 milliseconds.
Comparison of the Efficiency of string equals and Int = Methods