2.2 标识符

/**
 * 测试标识符的用法
 * @author Hank
 *
 */
public class TestIdentifer {
    
    public static void main(String[] args) {
        int a123 = 1;
        // int 123abc=2;    //数字不能开头
        int $a = 3;
        int _abc = 4;
        //int #abc = 5;
        
        int 年龄 = 18;    //可以使用汉字,但是一般不建议
        
        //int class=2;  //关键字不能作为标识符
        
    }

}

猜你喜欢

转载自www.cnblogs.com/hankleo/p/11070045.html