提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
角色类实例方法
public class Main { public static void main(String[] args) /* from n o w j a v a . c o m - 时 代 Java*/ { Character c1 = 'A'; Character c2 = 'a'; System.out.printf( "c1 = %s\nc2 = %s\n\n", c1.charValue(), c2.toString()); if (c1.equals(c2)) System.out.println("c1 and c2 are equal\n"); else System.out.println("c1 and c2 are not equal\n"); } }