java 类和对象的小练习,输出英文字母表大小写

package lianxiti;

public class Print {
    void output(int x)
    {
        if(x==1)
        {
            System.out.println("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
        }
        else if(x==2)
        {
            System.out.println("abcdefghijklmnopqretuvwxyz");
        }
        else
        {
            System.out.println("您输入有误");
        }
    }

}
package lianxiti;

public class TestClass {

    public static void main(String[] args) {
        // TODO 自动生成的方法存根

        Print p1 = new Print();
        p1.output(2);
    }

}

posted @ 2016-05-19 16:39  ╄承诺、带给的伤痛—  阅读(723)  评论(0编辑  收藏  举报