Java.lang.Character.charValue() 方法


Java.lang.Character.charValue() 方法

package com.codingdict;



import java.lang.*;



public class CharacterDemo {



   public static void main(String[] args) {



      // create a Character object c

      Character c;



      // assign value to c

      c = new Character('a');



      // create a char primitive ch

      char ch;



      // assign primitive value of c to ch

      ch = c.charValue();



      String str = "Primitive char value is " + ch;



      // print ch value

      System.out.println( str );

   }

}