On Tue, 10 Jan 2023 18:40:28 GMT, Justin Lu <d...@openjdk.org> wrote:

> > Given that type conversions create the primitive wrapper instances when 
> > they are needed, I think the examples should be reconsidered. They 
> > needlessly suggest that the wrapper instances need to be explicitly created.
> 
> Hi Roger, thanks for the comment,
> 
> When I was deciding between autoboxing and using the valueOf() methods, I 
> personally saw the latter as providing more clarity from a documentation 
> standpoint but I understand your concerns. Curious what others think on the 
> decision of using one vs the other.

I concur that it is clearer to readers to have the explicit valueOf call in the 
code examples.

-------------

PR: https://git.openjdk.org/jdk/pull/11912

Reply via email to