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); } }