wrapper-classes
6 tutorials tagged “wrapper-classes”.
- Autoboxing and Unboxing in JavaJava converts between primitives and wrappers automatically. Where it happens, the valueOf and intValue calls it hides, and its NullPointerException traps.
- Character Class Methods in JavaCheck and convert single characters with the Character class: letters, digits, case and white space, plus why char is secretly a number.
- Integer Cache in JavaWhy Integer 127 == 127 is true but 128 == 128 is false: the -128 to 127 cache behind valueOf, other wrapper caches, and the safe way to compare.
- Integer.parseInt() vs Integer.valueOf()Convert text to numbers: parseInt returns an int, valueOf returns a cached Integer. Radix, signs, the NumberFormatException messages, and which to choose.
- Converting Between String and Other TypesTurn text into numbers and booleans, and anything into text: parseInt, valueOf, toString, char arrays, number bases, and the errors to expect.
- Wrapper Classes in JavaInteger, Double, Character and friends: why each primitive has an object twin, when you need one, their constants and helper methods, and pitfalls.