【分录题】(4-1)写出下面程序运行结果。 public class Demo { public static void main(String[] args) { int a[]={1,3,5,7,9,11,13}; int b[]=new int[10]; int sum=0; System.arraycopy(a,2,b,3,3); for(int x:b) sum=sum+x; System.out.println(sum); } }
第1题
第2题
第3题
【分录题】(7-12)请阅读程序,写出程序运行结果。 class A{ static String name="tom"; static int getX() { return 2; } int getY() { return 3; } } class B extends A{ static String name="Tuny"; static int getX() { return 4; } int getY() { return 5; } } class C extends A{ static String name="Tuny"; static int getX() { return 4; } int getY() { return 5; } } interface D{ int getY(); } class E implements D{ public int getY() { return 6; } } public class Demo{ public static void main(String[] args) { A a=new A(); A b=new B(); A c=new C(); D d=new E(); int sum=a.name.length()+b.getX()+c.getY()+d.getY(); System.out.println(sum); } }
第4题
第5题
第6题
第7题
第8题
第9题
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!