package review20140418;
/*
 * 声明变量(1.区分大小写 2.首写字母不能以数字开头
 *  3.不能使用关键字 4.可以一$字母,下划线开头)
 */
public class Test2 {
    //程序的入口
    public static void main(String[] args) {
        
        /* 整数类型*/        
        byte a1=1;
        short a2=1;
        int a3=1;
        long a4=1;
        
        /*浮点类型*/
        float b1=1.1f;
        float b2=1.1F;
        double b3=1.2;
        
        //字符型
        char c='A';
        
        //布尔类型
        boolean d=true;
        
        /*打印出结果*/
        System.out.println(a1);
        System.out.println(a2);
        System.out.println(a3);
        System.out.println(a4);
        System.out.println(b1);
        System.out.println(b2);
        System.out.println(b3);
        System.out.println(c);
        System.out.println(d);
    }
}

输出结果

1
1
1
1
1.1
1.1
1.2
A
true

posted on 2016-04-19 18:47  yegcf  阅读(129)  评论(0)    收藏  举报