In Java, mind the difference between primitives and their wrappers

Photo by freestocks on Unsplash

Knowing and understanding the difference between objects and primitives in Java is one of those things that we should expect of every Java programmer, even though in practice it won’t make any difference in program performance.

In some contexts, you can’t use a primitive without causing an error, you must use the wrapper. But in other contexts, you…