Convert a primitive char value to Character object
The Character constructor helps us to create an object representation of a primitive char value.
public class CharWrapper {
public static void main(String[] args) {
char c = 'A';
Character objChar = new Character(c);
System.out.println(objChar);
}
}
Tags: char, Character, Character examples, Character wrapper class, java.lang, java.lang.Character
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Leave a Reply