源碼如下:/***Returnsan{@codeInteger}instancerepresentingthespecified*{@codeint}value.Ifanew{@codeInteger}instanceisnot*required,thismethodshouldgenerallybeusedinpreferenceto*theconstructor{@link#Integer(int)},asthismethodislikely*toyieldsignificantlybetterspaceandtimeperformanceby*cachingfrequentlyrequestedvalues.**Thismethodwillalwayscachevaluesintherange-128to127,*inclusive,andmaycacheothervaluesoutsideofthisrange.**@paramian{@codeint}value.*@returnan{@codeInteger}instancerepresenting{@codei}.*@since1.5*/publicstaticIntegervalueOf(inti){if(i>=IntegerCache.low&&i
今天看了一下integer源碼,為什么integer.valueOf(-120)結果還是-120呢?
海綿寶寶撒
2019-05-22 22:01:35