百川同达 Jaa 程序员应聘摸底考试题.docVIP

  • 24
  • 0
  • 约1.86万字
  • 约 15页
  • 2016-10-14 发布于贵州
  • 举报
百川同达 Jaa 程序员应聘摸底考试题

百川同达 Java 程序员应聘摸底考试题 一、选择题。(2*11 分) 1. class ExSuper { String name; String nick_name; public ExSuper(String s,String t){ name = s; nick_name = t; } public String toString(){ return name; } } public class Example extends ExSuper{ public Example(String s,String t){ super(s,t); } public String toString(){ return name + a.k.a + nick_name; } public static void main(String args[]){ ExSuper a = new ExSuper(First,1st); ExSuper b = new Example(Second,2nd); System.out.println(a is + a.toString()); System.out.println(b is + b.toString()); } } 编译时会出现异常。 运行结果为: a is First b is second C. 运行结果为: a is First b is Secong a.k.a 2nd D. 运行结果为: a is First a.k.a 1nd b is Second a.k.a 2nd 2. abstract class MineBase{ abstract void amethod(); static int i; } public class Mine extends MineBase{ public static void main(String argv[]){ int[] ar = new int[5]; for (int i = 0; i ar.length; i++) System.out.println(ar[i]); } } A. 打印 5 个0。 B. 编译出错,数组 ar[] 必须初始化。 C.编译出错, Mine 应声明为abstract。 D. 出现 IndexOutOfBoundes 的例外。 3. public class Foo { public static void main(String[] args){ try { return;} finally { System.out.println(Finally); } } } 程序正常运行,但不输出任何结果。 程序正常运行,并输出 “Finally”。 编译能通过,但运行时会出现一个例外。 因为没有 catch 语句块,所以不能通过编译 4. 以下 sql 语句正确的是: A.select studentid,depart,count(*) from student group by depart; B.select studentid, count(*) from student; C.select depart,max(avg(age))from student group by depart; D.select studentid,avg(score),max(score)from score group by studentid 5. jsp:useBean 标签中 scope 的范围由小到大是 A page session request application B. application page request session C. application session request page D. page request session application 6. 要让用户共享一个 JavaBean 的对象则该对象的范围应改设置为: A. session B. p

文档评论(0)

1亿VIP精品文档

相关文档