How to Create Wrapper Objects in Java


In this example we will show how to create wrapper objects in Java.

Source Code

package com.beginner.examples;

public class WrapperObject { 
  public static void main(String[] args) {
    Integer a = 11; // create wrapper objects
    Double b = 3.14;
    Character c = 'b';
    System.out.println(a);
    System.out.println(b);
    System.out.println(c);
  }
}

Output:

11
3.14
b
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments