把ASCii码大于128的作为汉字,小于128的作为字母,即可!

解决方案 »

  1.   

    public class test 
    {
    public static void main(String[] args) 
    {  
                      String str="Java开123发";
    for(int i=0;i<str.length();i++)
    {
    char c=str.charAt(i);
    if(c>256)
                                { 
    System.out.println("汉字:"+c);
                                }
    else 
                                {
    System.out.println("字母(包括数字):"+c);
                                }
    }
    }
    }
      

  2.   

    char c = '阿';
    int value = (int)c;
    System.out.println(value);     (1)0000~007Fh:基本拉丁字母区。其中0000~001Fh为C0控
             制码,0020h为空格(space),0021~007Eh为ASCII图形
             字符,007Fh为句柄DEL。事实上,这128个字符码只要
             把前8个位去掉就可变成习见的8位形式的ASCII码。      (2)0080~00A0h:句柄区。其中0080~009Fh为C1句柄,
             00A0h为不中断空格(no-break space)。      (3)00A1~1FFFh:拼音文字区。收容除基本拉丁字母以外的各种
             拼音文字字符,包括欧洲各国语言、希腊文、斯拉夫语文、
             希伯来文、阿拉伯文、亚美尼亚文、印度各地方言、马来文、
             泰文、寮文、柬普寨文、满文、蒙文、藏文、印地安语文等。      (4)2000~28FFh:符号区。收容各种符号,包括标点符号、上下
             标、钱币符号、数字、箭头、数学符号、工程符号、光学辨
             识符号、带圈或带括符的文数字、表格绘制符号、地理图标、
             盲用点字、装饰图形等。      (5)2E80~33FFh:中日韩符号区。收容康熙字典部首、中日韩辅
             助部首、注音符号、日本假名、韩文音符,中日韩的符号、
             标点、带圈或带括符文数字、月份,以及日本的假名组合、
             单位、年号、月份、日期、时间等。      (6)3400~4DFFh:中日韩认同表意文字扩充A区,总计收容6,582
             个中日韩汉字。      (7)4E00~9FFFh:中日韩认同表意文字区,总计收容20,902个中
             日韩汉字。
      

  3.   

    please refer to Class Character in the package java.lang
      Method Summary 
     char charValue() 
              Returns the value of this Character object. 
     int compareTo(Character anotherCharacter) 
              Compares two Character objects numerically. 
     int compareTo(Object o) 
              Compares this Character object to another object. 
    static int digit(char ch, int radix) 
              Returns the numeric value of the character ch in the specified radix. 
     boolean equals(Object obj) 
              Compares this object against the specified object. 
    static char forDigit(int digit, int radix) 
              Determines the character representation for a specific digit in the specified radix. 
    static byte getDirectionality(char c) 
              Returns the Unicode directionality property for the given character. 
    static int getNumericValue(char ch) 
              Returns the int value that the specified Unicode character represents. 
    static int getType(char ch) 
              Returns a value indicating a character's general category. 
     int hashCode() 
              Returns a hash code for this Character. 
    static boolean isDefined(char ch) 
              Determines if a character is defined in Unicode. 
    static boolean isDigit(char ch) 
              Determines if the specified character is a digit. 
    static boolean isIdentifierIgnorable(char ch) 
              Determines if the specified character should be regarded as an ignorable character in a Java identifier or a Unicode identifier. 
    static boolean isISOControl(char ch) 
              Determines if the specified character is an ISO control character. 
    static boolean isJavaIdentifierPart(char ch) 
              Determines if the specified character may be part of a Java identifier as other than the first character. 
    static boolean isJavaIdentifierStart(char ch) 
              Determines if the specified character is permissible as the first character in a Java identifier. 
    static boolean isJavaLetter(char ch) 
              Deprecated. Replaced by isJavaIdentifierStart(char). 
    static boolean isJavaLetterOrDigit(char ch) 
              Deprecated. Replaced by isJavaIdentifierPart(char). 
    static boolean isLetter(char ch) 
              Determines if the specified character is a letter. 
    static boolean isLetterOrDigit(char ch) 
              Determines if the specified character is a letter or digit. 
    static boolean isLowerCase(char ch) 
              Determines if the specified character is a lowercase character. 
    static boolean isMirrored(char c) 
              Determines whether the character is mirrored according to the Unicode specification. 
    static boolean isSpace(char ch) 
              Deprecated. Replaced by isWhitespace(char). 
    static boolean isSpaceChar(char ch) 
              Determines if the specified character is a Unicode space character. 
    static boolean isTitleCase(char ch) 
              Determines if the specified character is a titlecase character. 
    static boolean isUnicodeIdentifierPart(char ch) 
              Determines if the specified character may be part of a Unicode identifier as other than the first character. 
    static boolean isUnicodeIdentifierStart(char ch) 
              Determines if the specified character is permissible as the first character in a Unicode identifier. 
    static boolean isUpperCase(char ch) 
              Determines if the specified character is an uppercase character. 
    static boolean isWhitespace(char ch) 
              Determines if the specified character is white space according to Java. 
    static char toLowerCase(char ch) 
              Converts the character argument to lowercase using case mapping information from the UnicodeData file. 
     String toString() 
              Returns a String object representing this Character's value. 
    static String toString(char c) 
              Returns a String object representing the specified char. 
    static char toTitleCase(char ch) 
              Converts the character argument to titlecase using case mapping information from the UnicodeData file. 
    static char toUpperCase(char ch) 
              Converts the character argument to uppercase using case mapping information from the UnicodeData file.