//Character包装类
public class test23 {public static void main(String[] args){char ch='A';//使用构造方法Character obj1=new Character('中');//使用静态方法Character obj2=Character.valueOf(ch);//获取char值char zhong=obj1.charValue();System.out.println(zhong);int res=obj2.compareTo('B');System.out.println(res);String str=obj1.toString();System.out.println(str.length());}
}
运行结果