Loading topic
int and double hold raw values. Reference types such as String, ArrayList and Integer hold references to objects. Wrapper classes exist because the two families do not mix freely. This chapter explains why the split exists and what it6 min readint, long, double, boolean, char), basic class and object syntax, how == and equals differ on objects, and basic List and Map use with generics. It introduces the eight wrapper classes and what they offer. The next chapters cove6 min readint, long, double, boolean, char), basic class and object syntax, how == and equals differ on objects, and how to use List and Map with generics. You should also know that each primitive has a wrapper class such as Integer or 6 min readInteger, Long, Double, Boolean, `Cha5 min read== and equals on objects. It also assumes you have seen autoboxing, where the compiler converts between int and Integer for you. Here you will see which method the compiler calls 6 min read== and equals differ on objects, and what autoboxing does at a basic level. Here you will see why == on two Integer variables can return true for one value and false for another. You will also see what the cache behind that behavi7 min readInteger.valueOf caches small values. Here you will learn which comparison operator to use on wrappers, and why the wrong choice sometimes passes your tests and then fails later.5 min read== and equals behave on objects, and how to use List and Map with generics. It also assumes you have met autoboxing, where the compiler converts between int and Integer for you.6 min readint and Integer. It covers how the compiler picks one method when several overloads could accept a call, and why boxing sits low in the priority order.5 min read== and equals on objects, and simple use of List and Map with generics. It also assumes you have seen autoboxing and unboxing, covered earlier in this tutorial. Here you will see wher5 min readdouble values that break ordinary equality: NaN and negative zero. It assumes you know the following:5 min readList/Map work, and the difference between == and equals. It also assumes you have read the earlier chapters on autoboxing, unboxing and the wrapper cache. Here we look at what boxing costs at run time, where that cost sho7 min read