Wrapper classes correspond to the primitive data types in the Java language. These classes represent the primitive values as objects. All the wrapper classes except Character have two constructors -- one that takes the primitive value and another that takes the String representation of the value. For instance:
Integer i1 = new Integer(50); Integer i2 = new Integer("50");
The Character class constructor takes a char type element as an
As you know, Strings are objects in Java code. These objects, however, are immutable. That is, their value, once assigned, can never be changed. For instance:
String msg = "Hello"; msg += " World";
Here the original String "Hello" is not changed. Instead, a new String is created with the value "Hello World" and assigned to the variable