About 48,600 results
Open links in new tab
  1. design patterns - What is a wrapper class? - Stack Overflow

    May 20, 2009 · A wrapper class (as adapter) is used when the wrapper must respect a particular interface and must support a polymorphic behavior. On the other hand, a facade is used when …

  2. Java: Why are wrapper classes needed? - Stack Overflow

    A wrapper class wraps (encloses) around a data type (can be any primitive data type such as int, char, byte, long) and makes it an object. Here are a few reasons why wrapper classes are …

  3. java - Why we need wrapper class - Stack Overflow

    Dec 20, 2013 · I understand what is a wrapper class, they primitive types (eg: int, double, etc) to objects of their respective class (eg: Integer, Double, etc). But, why we need Wrapper classes, …

  4. When to use wrapper class and primitive type - Stack Overflow

    Oct 15, 2009 · When I should go for wrapper class over primitive types? Or On what circumstance I should choose between wrapper / Primitive types?

  5. Why are Java wrapper classes immutable? - Stack Overflow

    However, wrapper classes represent primitive types, and primitive types (except String) are mutable. Firstly, String isn't a primitive type. Secondly, it makes no sense to talk about the …

  6. Wrapper classes and call by reference in java - Stack Overflow

    Dec 28, 2013 · 1 The wrapper classes are immutable, so operations like addition and subtraction create a new object and not modify the old. If you want to pass a primitive by reference, one …

  7. Why are there wrapper classes in Java? - Stack Overflow

    2 Wrapper Class: Java uses primitive types, such as int, char, double to hold the basic data types supported by the language. Sometimes it is required to create an object representation of …

  8. What is the real difference between primitives and wrapper classes …

    Aug 7, 2020 · To solve this problem, wrapper classes were created. Now, instead of needing 8 separate implementations of dynamic array (1 for reference types and 7 for primitive types), …

  9. Using == operator in Java to compare wrapper objects

    0 When the Java == operator is used to compare anything other than primitive types, it checks for referential equality; this applies even when the things being compared are wrapped primitives.

  10. Are Java wrapper classes really immutable? - Stack Overflow

    Oct 3, 2014 · All wrapper classes in java are immutable. We can't change the value of a wrapper class object once created, i.e., can't change the value wrapped inside the object. Because …