GoConqr has a new look! Let us know what you think.

Mind map

Wrapper Classes

Tate Johnson Computer Science English

Map content

Wrapper Classes

  1. **ALL PRIMITIVES HAVE A WRAPPER CLASS**

  2. Wrapper classes do not have no-args constructors.

  3. Constructing a wrapper class:

    • Ex: Interger i1 = new Integer("5")
      • Also: Integer i1 = new Integer(5)
  4. Ops/Methods:

    • datatypeValue() ex: intValue: turns whatever its called on into an int
      • valueOf(String s): creates a new object initialized to the value represented in the string.
        • compareTo(value): compares two Wrapper classes together returns 1 if >, -1 if <. & 0 if =
          • parseInt(String s) or parseDouble(String s): returns the int or double value of the inputted String. Call it like this: Integer.parseInt("12")
  5. Autoboxing: going from a primitive data type to a Wrapper Object.

    • Ex: Integer int1; int val = 12; int1 = val;
  6. Unboxing: going from a primitive data type to a Wrapper object.

    • Integer int2 = new Integer(14); int val2; val2 = int2

Information

Description
Computer Science Mind Map on Wrapper Classes, created by Tate Johnson on 27/04/2021.
Created by
Tate Johnson
Views
2
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?