1. 程式人生 > >輸出英文字母

輸出英文字母

package test;/*
@author wb
@great forever
i think,therefor i am
*/
public class test {

    public test(boolean isUppperCase){
        char start = isUppperCase? 'A':'a';
        char end = isUppperCase? 'Z':'z';

        while(start <= end){
            System.out.print(start);
            start++;
        }

        System.out.println();
    }

    public test(){
        this(false);
    }

    public static void main(String[] args) {
        new test();//預設輸出小寫字目標
        System.out.println();
        new test(true);//大寫就傳引數true

    }

}