/**
*<p>项目名称: Java</p>
*<p>文件名称: CharacterTest</p>
*<p>版权所有: 版权所有(C)2008-2010</p>
*<p>公 司: </p>
*<p>编写日期: 2008-7-9上午07:50:36</p>
*<p>作 者: huangtao</p>
*/
/**
* @author huangtao
*
*/
public class CharacterTest
{
public static void main(String[] args)
{
//获取unicode码
for(int i = 0 ; i<100 ; i++)
{
char[] ch = new char[100];
ch[i] = (char) i;
System.out.println(Character.codePointAt(ch , i));
System.out.println(Character.codePointAt(ch , i , 50));
if (i==49)
{
break;
}
}
//声明Character对象
Character ch1=new Character('1');
Character ch2=new Character('2');
System.out.println(ch1.compareTo(ch2));
System.out.println(ch2.compareTo(ch1));
//返回基于相应基数的数
System.out.println("changeone");
System.out.println(Character.digit('1' , 2));
System.out.println(Character.digit('1' , 8));
System.out.println(Character.digit('1' , 10));
System.out.println(Character.digit('1' , 16));
//把数转换成基于相应的字符
System.out.println("changetwo");
System.out.println(Character.forDigit(1 , 2));
System.out.println(Character.forDigit(7 , 8));
System.out.println(Character.forDigit(9 , 10));
System.out.println(Character.forDigit(10 , 16));
//各种判断
System.out.println(Character.isDigit('1'));
System.out.println(Character.isDigit('a'));
System.out.println(Character.isJavaIdentifierPart('i'));
System.out.println(Character.isJavaIdentifierStart('j'));
System.out.println(Character.isLetter('1'));
System.out.println(Character.isLetterOrDigit('1'));
System.out.println(Character.isMirrored('a'));
System.out.println(Character.isSpaceChar('_'));
System.out.println(Character.isUpperCase('a'));
System.out.println(Character.isLowerCase('a'));
System.out.println(Character.isValidCodePoint(' '));
System.out.println(Character.isTitleCase('a'));
System.out.println(Character.isTitleCase('A'));
}
}