Primitive types such as int, char, float, etc. are NOT classes. Thus one cannot use methods such as
|
ALL primitive types have associated wrappers:
-
Character myChar = new Character( 'A' );
|
The Character class has methods such as:
-
if ( myChar.equals( ch ) ) ...
-
System.out.print( myChar.toString() );
|
There are also many static (class) methods:
-
ch = Character.toLowerCase( myChar );
-
if ( Character.isUpperCase( myChar ) ) ...
|
The methods in a wrapper class are also useful to convert types, such as a String to a Double.
|