Skip to content

I20210328-1800

@vogella vogella tagged this 27 Mar 10:17
A boxed primitive is created from a String, just to extract the unboxed
primitive value.It is more efficient to just call the static parseXXX
method.


Before:
int number = Integer.valueOf("42", 8);
new Double("42.42").doubleValue();

After:

int number = Integer.parseInt("42", 8);
Double.parseDouble("42.42");

Change-Id: I6ac31e2e8c985e87fc3281f4e29b86db592f4c94
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Assets 2
Loading